Fix DatabaseCacheDriver::get SQL select

- Fix typo
- Fix wrong usage of NOW()
This commit is contained in:
Hypolite Petovan 2018-03-01 00:33:44 -05:00
parent 41d5c7d4c7
commit 3df34d33d5

View file

@ -16,7 +16,7 @@ class DatabaseCacheDriver implements ICacheDriver
{ {
public function get($key) public function get($key)
{ {
$cache = dba::selectFirst('cache', ['v'], ['`k` = ? AND `expires` >= NOW()`', $key]); $cache = dba::selectFirst('cache', ['v'], ['`k` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
if (DBM::is_result($cache)) { if (DBM::is_result($cache)) {
$cached = $cache['v']; $cached = $cache['v'];