mirror of
https://github.com/friendica/friendica
synced 2025-04-25 04:30:11 +00:00
friendica-5847 Console Cache List command doesn't work
- filterPrefix => filterArrayKeysByPrefix() - Logging failed Executions of getAllKeys and get from Memcached
This commit is contained in:
parent
3f0f3b6ae6
commit
1ec5c6b284
5 changed files with 26 additions and 28 deletions
|
@ -44,21 +44,22 @@ abstract class AbstractCacheDriver extends BaseObject
|
|||
}
|
||||
|
||||
/**
|
||||
* Filters a list for a given prefix
|
||||
* Filters the keys of an array with a given prefix
|
||||
* Returns the filtered keys as an new array
|
||||
*
|
||||
* @param array $list the list
|
||||
* @param string|null $prefix the prefix
|
||||
* @param array $array The array, which should get filtered
|
||||
* @param string|null $prefix The prefix (if null, all keys will get returned)
|
||||
*
|
||||
* @return array the filtered list
|
||||
* @return array The filtered array with just the keys
|
||||
*/
|
||||
protected function filterPrefix($list, $prefix = null)
|
||||
protected function filterArrayKeysByPrefix($array, $prefix = null)
|
||||
{
|
||||
if (empty($prefix)) {
|
||||
return array_keys($list);
|
||||
return array_keys($array);
|
||||
} else {
|
||||
$result = [];
|
||||
|
||||
foreach (array_keys($list) as $key) {
|
||||
foreach (array_keys($array) as $key) {
|
||||
if (strpos($key, $prefix) === 0) {
|
||||
array_push($result, $key);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue