*
* @param string $prefix Prefix of the keys (optional)
*
- * @return array|null Null if the driver doesn't support this feature
+ * @return array Empty if the driver doesn't support this feature
*/
public static function getAllKeys($prefix = null)
{
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;
}
/**
*
* @param string prefix optional a prefix to search
*
- * @return array|null Null if it isn't supported by the cache driver
+ * @return array Empty if it isn't supported by the cache driver
*/
public function getAllKeys($prefix = null);