]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Cache/AbstractCacheDriver.php
Merge pull request #5862 from nupplaphil/rename_App_Methods
[friendica.git] / src / Core / Cache / AbstractCacheDriver.php
index e694b9c31405ba8b7ee93837c1664c0de0092374..c2628551ef47be5dee31908af0b883e0520a37e4 100644 (file)
@@ -20,7 +20,7 @@ abstract class AbstractCacheDriver extends BaseObject
        protected function getCacheKey($key)
        {
                // We fetch with the hostname as key to avoid problems with other applications
-               return self::getApp()->get_hostname() . ":" . $key;
+               return self::getApp()->getHostName() . ":" . $key;
        }
 
        /**
@@ -34,7 +34,7 @@ abstract class AbstractCacheDriver extends BaseObject
                } else {
                        // Keys are prefixed with the node hostname, let's remove it
                        array_walk($keys, function (&$value) {
-                               $value = preg_replace('/^' . self::getApp()->get_hostname() . ':/', '', $value);
+                               $value = preg_replace('/^' . self::getApp()->getHostName() . ':/', '', $value);
                        });
 
                        sort($keys);
@@ -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);
                                }