Get the expired cache identifiers.

@return array
498175
public function findExpiredIdentifiers(): array
    {
        $queryBuilder = $this->createQuery();
        $rows = $queryBuilder->select('identifier')
            ->from($this->getTableName())
            ->where($queryBuilder->expr()->lt(
                'expires',
                $queryBuilder->createNamedParameter((new DateTimeService())->getCurrentTime(), \PDO::PARAM_INT)
            ))
            ->groupBy('identifier')
            ->execute()
            ->fetchAll();

        $cacheIdentifiers = [];
        foreach ($rows as $row) {
            $cacheIdentifiers[] = $row['identifier'];
        }

        return $cacheIdentifiers;
    }
842620
private function cache()
	{
		if (!$this->cache)
		{
			return false;
		}

		// get developer params to get cache expiration
		if (App::has('component'))
		{
			$developerParams = App::get('component')->params('com_developer');
		}
		else
		{
			$developerParams = new \Hubzero\Config\Registry();
		}
		$cacheExpiration = $developerParams->get('doc_expiration', 720);

		// cache file
		$cacheFile = PATH_APP . DS . 'cache' . DS . 'api' . DS . 'documentation.json';

		// check if we have a cache file 
		if (file_exists($cacheFile))
		{
			// check if its still valid
			$cacheMakeTime = @filemtime($cacheFile);
			if (time() - $cacheExpiration < $cacheMakeTime)
			{
				$this->output = json_decode(file_get_contents($cacheFile), true);
				return true;
			}
		}

		return false;
	}
544530
public function cacheKeys()
    {
        $keys = [];
        $roles = array_merge(cache('roles'), ['guest']);

        foreach ($roles as $role) {
            $keys[] = $this->generateCacheKey($role);
        }

        return implode('|', $keys);
    }
1273227
private function getExpireTime(){
        $config = $this->plume();
        return isset($config['plume.cache.config'][$config['plume.request.path']]) ? $config['plume.cache.config'][$config['plume.request.path']] : $config['plume.cache.expire'];
    }
1061447
protected function _get_index()
	{
		// get the section name and identifier
		$sections = explode('.', $this->identifier);
		if (count($sections) > 1)
		{
			$identifier = array_pop($sections);
			$sections = '.'.implode('.', $sections);
		}
		else
		{
			$identifier = $this->identifier;
			$sections = '';
		}

		// get the cache index and return it
		return array($identifier, $sections, static::$redis->get($this->config['cache_id'].':index:'.$sections));
	}
10038
public function isExpired() : bool
    {
        $expiresAt = $this->getCache()->get($this->getKey())['expires_at'] ?? null;

        return empty($expiresAt) || Carbon::parse($expiresAt)->lt(Carbon::now());
    }
395836
public function expired()
    {
        if (empty($this->expiresOn)) {
            return false;
        }

        return AnDomainAttributeDate::getInstance()->toDate()->compare($this->expiresOn) > 0;
    }
851869
public function clearExpired() {

		$files = glob(Path :: get('cache-shared') . '*');
		
		if(true === is_array($files) && count($files) > 0) {

			foreach($files as $file) {
			  	
			  	$file 		= new File($file);
				$expiration = $this -> extractExpiration($file);

				if($expiration -> time <= time()) {
					$file -> delete();
				}
			}
		}
		
		return $this;
	}
998114
public function getIds()
    {
        $this->_checkAndBuildStructure();
        $res = $this->_query("SELECT id FROM cache WHERE (expire=0 OR expire>" . time() . ")");
        $result = array();
        while ($id = @sqlite_fetch_single($res)) {
            $result[] = $id;
        }
        return $result;
    }
456418
public function getCookies()
    {
        $cookies = [];
        $pattern = '#Set-Cookie: (.*?)=(.*?);#im';
        if (preg_match_all($pattern, $this->header . $this->body, $match)) {
            foreach ($match[1] as $co => $vo) {
                if (strtoupper($match[2][$co]) != 'EXPIRED') {
                    $cookies[$vo] = $match[2][$co];
                }
            }
        }
        return $cookies;
    }
1015049
private function getExpired()
    {
        if (count($this->expired) < 1) {
            return null;
        }
        $expired = key($this->expired);
        $this->increment($this->expired);
        return $expired;
    }
284609
public function getCaches()
    {
        if (!$this->caches) {
            foreach (Cache::getBins() as $name => $bin) {
                $this->caches[$name] = $bin;
            }
        }

        return $this->caches;
    }
1114079
public static function flushAll()
    {
        $cachesInfo = [];
        if (empty($caches = self::findCaches())) {
            return $cachesInfo;
        }
        
        foreach ($caches as $name => $class) {
            $cachesInfo[] = [
                'name' => $name,
                'class' => $class,
                'is_flushed' => self::canBeFlushed($class) ? Yii::$app->get($name)->flush() : false,
            ];
        }
        
        return $cachesInfo;
    }
1181376
public function getDefinitionCache(): array
    {
        return [
            $this->name,
            $this->methods,
            $this->segments,
            $this->patterns,
            $this->handler,
            $this->format,
            $this->parameterNames,
        ];
    }
1338383
public function deleteExpired()
    {
        $cache = $this->loadCache();
        if (is_array($cache)) {
            $i = 0;
            $cache = array_map(function ($value) use (& $i) {
                if (!$this->isExpired($value['time'], $value['expire'])) {
                    ++$i;
                    return $value;
                }
            }, $cache);
            if ($i > 0) {
                $this->saveCache($cache);
            }
        }
        return $this;
    }
126917
public static function get($identifier, $use_expiration = true)
	{
		$cache = static::forge($identifier);
		return $cache->get($use_expiration);
	}
998992
protected function getIDList() : array
    {
        //Get element ID list from cache
        $arElementIDList = $this->getIDListFromCache();
        if (!empty($arElementIDList) && is_array($arElementIDList)) {
            return $arElementIDList;
        }

        $arElementIDList = $this->getIDListFromDB();
        $this->saveIDList($arElementIDList);

        return $arElementIDList;
    }