Checks the freshness of AOP cache

@return bool Whether or not concrete file is fresh
960884
public function isFresh(int $timestamp): bool
    {
        if (!$this->maxTimestamp && !empty($this->resources)) {
            $this->maxTimestamp = max(array_map('filemtime', $this->resources));
        }

        return $this->maxTimestamp <= $timestamp;
    }
579399
public function hasActualContainer(): bool
    {
        if (false === $this->environment->isDebug())
        {
            return true === $this->configCache()->isFresh();
        }

        return false;
    }
433502
public function isFile(): bool
    {
        if ($this->caching == false) {
            return is_file($this->getAbsoluteFilePath());
        }

        if ($this->isFile == null) {
            $this->isFile = is_file($this->getAbsoluteFilePath());
        }

        return $this->isFile;
    }
903658
public function isCached($cacheKey)
    {
        // TODO: Refactor for strict types!
        $path = $this->resolvePath($cacheKey, false);
        if (file_exists($path)) {
            return $path;
        } else {
            return false;
        }
    }
798580
private function saveData(): bool
    {
        if ($cacheTime = $this->getMeta()->getCache()) {
            return Cache::set(
                $this->key,
                $this->getData(),
                $cacheTime,
                ['system', 'data']
            );
        }
        return false;
    }
757611
public function isOutdated()
    {
        if ($this->Fetched) {
            $fetched = new \DateTime($this->Fetched);
            $now = new \DateTime("now");
            $diff = $now->getTimestamp() - $fetched->getTimestamp();
            if ($diff > Client::getRefreshRate()) {
                return true;
            }
            return false;
        }

        return true;
    }
1163646
def is_cached(self):
        """"""
        # TODO: cache by target+hash, not per file.
        try:
            for item in self.rule.output_files:
                log.info(item)
                self.cachemgr.in_cache(item, self._metahash())
        except cache.CacheMiss:
            log.info('[%s]: Not cached.', self.address)
            return False
        else:
            log.info('[%s]: found in cache.', self.address)
            return True
678610
protected function isSaved(): bool
    {
        return $this->filesystem->has($this->path)
            && $this->filesystem->getTimestamp($this->path) > $this->file->getUpdatedAt();
    }
1025985
def is_cache_valid(self):
        '''  '''

        if os.path.isfile(self.cache_path_cache):
            mod_time = os.path.getmtime(self.cache_path_cache)
            current_time = time()
            if (mod_time + self.cache_max_age) > current_time:
                if os.path.isfile(self.cache_path_index):
                    return True

        return False
948020
private function isCacheFresh( $cacheKey, \ReflectionClass $class )
	{
		if ( false === $filename = $class->getFileName() )
			return true;

		return $this->cache->fetch( '[C]' . $cacheKey ) >= filemtime( $filename );
	}
179694
public function clean()
    {
        if (!($files = $this->getCacheFiles())) {
            return false;
        }

        foreach ($files as $file) {
            $key = basename($file, $this->extension);
            $this->get($key); // Automatically deletes if expired
        }
        return true;
    }
768070
protected static function hasStaleCacheFile()
    {
        $composerTravisLintCache = getcwd()
            . DIRECTORY_SEPARATOR
            . self::CTL_CACHE;

        $travisConfiguration = getcwd()
            . DIRECTORY_SEPARATOR
            . self::TRAVIS_CONFIGURATION;

        if (file_exists($composerTravisLintCache) && file_exists($travisConfiguration)) {
            $travisConfigurationContent = trim(file_get_contents($travisConfiguration));
            $composerTravisLintCacheContent = trim(file_get_contents($composerTravisLintCache));

            if (md5($travisConfigurationContent) === $composerTravisLintCacheContent) {
                return false;
            }
        }

        return true;
    }
436306
public function saveCacheListing() : bool
    {

        if (md5(json_encode($this->entryMetaData)) === $this->md5Sum) {
            return false;
        }

        return $this->engine->set(self::KEY_CACHE_LIST, $this->entryMetaData);
    }
324528
public function flush()
    {
        $i = 0;
        $count = $this->count();

        while ($i < $count) {
            if (xcache_clear_cache(XC_TYPE_VAR, $i) === false) {
                return false;
            }

            $i++;
        }

        return true;
    }
942723
public function cliMode(): bool
    {
        if (!isset($this->cache[self::CLI_MODE])) {
            $this->cache[self::CLI_MODE] = php_sapi_name() === 'cli';
        }

        return $this->cache[self::CLI_MODE];
    }
1337046
public function flush() {
		$pattern = $this->getCachePath() . DIRECTORY_SEPARATOR . $this->prefix . '_*';
		
		if (self::isExecAvailable()) {
			exec('rm ' . $pattern);
			return true;
		}
		
		$list = glob($pattern);
		
		if ($list === false) {
			return false;
		}
		
		if (empty($list)) {
			return true;
		}
		
		$result = true;
		
		foreach ($list as $path) {
			if (! unlink($path)) {
				$result = false;
			}
		}
		
		return $result;
	}
1078991
static function isNoCacheAdviced()
    {
        if ( !isset( $GLOBALS['eZSiteBasics'] ) )
            return false;
        $siteBasics = $GLOBALS['eZSiteBasics'];
        if ( !isset( $siteBasics['no-cache-adviced'] ) )
            return false;
        return $siteBasics['no-cache-adviced'];
    }