Bugfixings for getAllKeys()

This commit is contained in:
Philipp Holzer 2018-10-07 22:14:05 +02:00
parent 8491f8660f
commit 7da6da6666
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
5 changed files with 8 additions and 7 deletions

View file

@ -21,18 +21,18 @@ class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
if (empty($prefix)) {
$where = ['`expires` >= ?', DateTimeFormat::utcNow()];
} else {
$where = ['`expires` >= ? AND k LIKE CONCAT(?, \'%\')', DateTimeFormat::utcNow(), $prefix];
$where = ['`expires` >= ? AND `k` LIKE CONCAT(?, \'%\')', DateTimeFormat::utcNow(), $prefix];
}
$stmt = DBA::select('cache', ['k'], $where);
$list = [];
$keys = [];
while ($key = DBA::fetch($stmt)) {
array_push($list, $key['k']);
array_push($keys, $key['k']);
}
DBA::close($stmt);
return $list;
return $keys;
}
/**