@see FileCache::listKeys()

@return string
Newline-delimited if argument modified-time.
13703
protected function cmdListKeys()
    {
        /**
         * @see simplecomplex_cache_cli()
         */
        $container = Dependency::container();
        // Validate input. ---------------------------------------------
        $store = '';
        if (empty($this->command->arguments['store'])) {
            $this->command->inputErrors[] = !isset($this->command->arguments['store']) ? 'Missing \'store\' argument.' :
                'Empty \'store\' argument.';
        } else {
            $store = $this->command->arguments['store'];
            if (!CacheKey::validate($store)) {
                $this->command->inputErrors[] = 'Invalid \'store\' argument.';
            }
        }
        $expired = 0;
        if (!empty($this->command->arguments['expired'])) {
            if (!ctype_digit('' . $this->command->arguments['expired'])) {
                $this->command->inputErrors[] = 'Invalid \'expired\' argument, must be 0|1|2.';
            } else {
                $expired = (int) $this->command->arguments['expired'];
                switch ($expired) {
                    case 0:
                    case 1:
                    case 2:
                        break;
                    default:
                        $this->command->inputErrors[] = 'Invalid \'expired\' argument, must be 0|1|2.';
                }
            }
        }
        $limit = 0;
        if (!empty($this->command->arguments['limit'])) {
            if (!ctype_digit('' . $this->command->arguments['limit'])) {
                $this->command->inputErrors[] = 'Invalid \'limit\' argument, must be digit(s).';
            } else {
                $limit = (int) $this->command->arguments['limit'];
                if ($limit < 0) {
                    if ($limit == -1) {
                        $limit = 0;
                    } else {
                        $this->command->inputErrors[] = 'Invalid \'limit\' argument, cannot be less than.';
                    }
                }
            }
        }
        $end_of_life = '';
        if (!empty($this->command->arguments['end-of-life'])) {
            $end_of_life = $this->command->arguments['end-of-life'];
        }

        $get = !empty($this->command->options['get']);
        if ($get && $end_of_life) {
            $this->command->inputErrors[] = 'Option \'get\' is not compatible with non-empty argument end-of-life.';
        }

        if ($this->command->inputErrors) {
            foreach ($this->command->inputErrors as $msg) {
                $this->environment->echoMessage(
                    $this->environment->format($msg, 'hangingIndent'),
                    'notice'
                );
            }
            // This command's help text.
            $this->environment->echoMessage("\n" . $this->command);
            exit;
        }
        // Check if the command is doable.------------------------------
        // Does that store exist?
        if ($container->has('cache-broker')) {
            /** @var CacheBroker $cache_broker */
            $cache_broker_class = get_class($container->get('cache-broker'));
        } else {
            $cache_broker_class = static::CLASS_CACHE_BROKER;
        }
        $cache_class = constant($cache_broker_class . '::CACHE_CLASSES')[CacheBroker::CACHE_BASE];
        if (!method_exists($cache_class, 'listInstances')) {
            $this->environment->echoMessage('Cannot retrieve list of cache store instances via class['
                . $cache_class . '], has no static method listInstances().', 'error');
            exit;
        }
        $stores = forward_static_call($cache_class . '::listInstances');
        $cache_store = null;
        foreach ($stores as $instance) {
            if ($instance->name == $store) {
                /** @var ManageableCacheInterface $cache_store */
                $cache_store = $instance;
                break;
            }
        }
        if (!$cache_store) {
            $this->environment->echoMessage('');
            $this->environment->echoMessage('That cache store doesn\'t exist, store[' . $store . '].', 'warning');
            exit;
        }

        // Check that cache store class has listKeys() method
        // isn't an interface requirement.
        if (!method_exists($cache_store, 'listKeys')) {
            $this->environment->echoMessage('Cache store[' . $store . '] class[' . get_class($cache_store)
                . '] has no method listKeys().', 'error');
            exit;
        }

        /**
         * @see FileCache::listKeys()
         */
        $cache_keys = $cache_store->listKeys($expired, $limit, $end_of_life);
        if (!$end_of_life) {
            if ($get) {
                return join(',', $cache_keys);
            }
            $this->environment->echoMessage(join("\n", $cache_keys));
        }
        else {
            $buffer = '';
            foreach ($cache_keys as $key => $end_time) {
                $buffer .= $key . ': ' . $end_time . "\n";
            }
            $this->environment->echoMessage(rtrim($buffer));
        }
        exit;
    }
167153
public function listCache()
    {

        $newlist = array();

        foreach ($this->cacheListing as $key => $val) {
            $newlist [$key] = new \stdClass();

            foreach ($val as $skey => $sval) {
                $newlist [$key]->$skey = $sval;
            }
        }

        $this->list = $newlist;

        return true;
    }
1225986
public function getKeys(): MList
    {
        $list = new MList();
        $list->appendArray(array_keys($this->map));

        return $list;
    }
1148103
protected function getPossibleKeys()
	{
		$keys = [];
		foreach (range('a', 'z') as $char)
		{
			$keys[] = $this->keyPrefix . $char;
		}

		return $keys;
	}
53035
public function getAllEntries()
    {
        if ($this->Using === 'APCu') {
            $Data = apcu_cache_info();
            if (empty($Data['cache_list'])) {
                return [];
            }
            $Output = [];
            foreach ($Data['cache_list'] as $Entry) {
                if (empty($Entry['info'])) {
                    continue;
                }
                $Creation = isset($Entry['creation_time']) ? $Entry['creation_time'] : 0;
                $Entry['Data'] = $this->getEntry($Entry['info']);
                $Output[$Entry['info']] = $Entry['ttl'] > 0 ? [
                    'Data' => $Entry['Data'],
                    'Time' => $Creation + $Entry['ttl']
                ] : $Entry['Data'];
            }
            return $Output;
        }
        if ($this->Using === 'Memcached') {
            $Keys = $this->WorkingData->getAllKeys();
            if ($Keys !== false && $this->WorkingData->getDelayed($Keys)) {
                $Data = $this->WorkingData->fetchAll();
            }
            if (!is_array($Data)) {
                return [];
            }
            $Output = [];
            foreach ($Data as $Entry) {
                if (!is_array($Entry) || !isset($Entry['key'], $Entry['value'], $Entry['cas'])) {
                    continue;
                }
                $Output[$Entry['key']] = ['Data' => $this->unserializeEntry($Entry['value'])];
                if ($Entry['cas'] > 2592000) {
                    $Output[$Entry['key']]['Time'] = $Entry['cas'];
                } else {
                    $Output[$Entry['key']] = $Output[$Entry['key']]['Data'];
                }
            }
            return $Output;
        }
        if ($this->Using === 'Redis') {
            $Keys = $this->WorkingData->keys('*') ?: [];
            $Output = [];
            foreach ($Keys as $Key) {
                $Output[$Key] = $this->unserializeEntry($this->WorkingData->get($Key));
            }
            return $Output;
        }
        if ($this->Using === 'PDO') {
            if ($this->clearExpiredPDO()) {
                $this->Modified = true;
            }
            $PDO = $this->WorkingData->prepare(self::getAllQuery);
            if ($PDO !== false && $PDO->execute()) {
                $Data = $PDO->fetchAll();
                $Output = [];
                foreach ($Data as $Entry) {
                    if (!is_array($Entry) || !isset($Entry['Key'], $Entry['Data'], $Entry['Time'])) {
                        continue;
                    }
                    $Output[$Entry['Key']] = $Entry['Time'] > 0 ? [
                        'Data' => $this->unserializeEntry($Entry['Data']),
                        'Time' => $Entry['Time']
                    ] : $this->unserializeEntry($Entry['Data']);
                }
                return $Output;
            }
            return [];
        }
        if ($Arr = ($this->exposeWorkingDataArray() ?: [])) {
            foreach ($Arr as &$Entry) {
                $Entry = $this->unserializeEntry($Entry);
            }
            return $Arr;
        }
        return [];
    }
1007137
protected function keys()
    {
        if (count($this->before()) > count($this->after())) {
            return $this->before();
        }

        return $this->after();
    }
1261201
private function filesFromKey()
    {
        try {
            return $this->manager->files()[$this->fileName];
        } catch (\ErrorException $e) {
            if ($this->confirm(sprintf('Language file %s.php not found, would you like to create it?', $this->fileName))) {
                $this->manager->createFile(str_replace($this->packageName.'::', '', $this->fileName));
            }

            return [];
        }
    }
1277330
public function getChildKeyList($key = null)
    {
        $child = $this->get($key);
        $list  = [];
        $n     = 0;
        foreach ($child as $k => $v) {
            $list[$n++] = $k;
        }
        return $list;
    }
1207935
public function getForeignKeys()
    {
        $return = [];
        $table = $this->getName();

        /** @var Base $call */
        foreach ($this->getGenericCalls() as $call) {
            if (isset($call->on) && $call->on !== $table) {
                $return[(string)$call->on] = $call;
            } // if
        } // foreach

        return $return;
    }
824677
public function getUsingFileTimestamps($key)
    {
        $value = $this->get($this->cacheKey($key));
        $timestamps = $this->get($this->cachetskey($key));

        if ($value !== false && $timestamps !== false) {

            foreach ($timestamps as $file => $timestamp) {

                if (filemtime($file) !== $timestamp)
                    return false;
            }

            return $value;
        }

        return false;
    }
1074351
private static function readKeys(): void
    {
        static::$keys = [];

        foreach (ini_get_all() as $key => $value) {
            static::$keys[$key] = $value['access'] === 1 /* user */ || $value['access'] === 7 /* all */;
        }
    }
109014
protected function generateCacheKey(): string
    {
        return sprintf(
            '%s:%s:%s',
            $this->command,
            $this->collection->getNamespace(),
            md5(serialize($this->params))
        );
    }
707163
public function getCacheKey(): string
    {
        return $this->getTypePrefix() . $this->getFlexType() . '.' . sha1(json_encode($this->getKeys()) . $this->_keyField);
    }
665159
public static function GetCacheLimiterList () {
		return [
			static::CACHE_LIMITER_PUBLIC				=> static::CACHE_LIMITER_PUBLIC,
			static::CACHE_LIMITER_PRIVATE_NO_EXPIRE		=> static::CACHE_LIMITER_PRIVATE_NO_EXPIRE,
			static::CACHE_LIMITER_PRIVATE				=> static::CACHE_LIMITER_PRIVATE,
			static::CACHE_LIMITER_NOCACHE				=> static::CACHE_LIMITER_NOCACHE,
			static::CACHE_LIMITER_NOT_SEND_HEADER		=> static::CACHE_LIMITER_NOT_SEND_HEADER,
		];
	}
252324
public function all( $keys = null ) {
		$input = array_replace_recursive( $this->input(), $this->all_files() );

		if ( ! $keys ) {
			return $input;
		}

		$results = [];

		foreach ( is_array( $keys ) ? $keys : func_get_args() as $key ) {
			Arr::set( $results, $key, Arr::get( $input, $key ) );
		}

		return $results;
	}
836884
static function treeCacheFilename( $key, $templateFilepath )
    {
        $internalCharset = eZTextCodec::internalCharset();
        $extraName = '';
        if ( preg_match( "#^.+/(.*)\.tpl$#", $templateFilepath, $matches ) )
            $extraName = '-' . $matches[1];
        else if ( preg_match( "#^(.*)\.tpl$#", $templateFilepath, $matches ) )
            $extraName = '-' . $matches[1];
        $cacheFileKey = "$key-$internalCharset";
        $cacheFileName = md5( $cacheFileKey ) . $extraName . '.php';
        return $cacheFileName;
    }
346009
protected function getCacheKey($ids)
    {
        $key = $this->cachePrefix;
        foreach ($ids as $id) {
            $key .= '-'.$id;
        }

        return $key;
    }