Checks the availability of the cache service.

@return bool
358852
public function isAvailable()
    {
        return \file_exists($this->cacheDir) && \is_dir($this->cacheDir) && \is_writable($this->cacheDir);
    }
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;
	}
1024320
public function has($key = '')
    {
        try {
            if ($this->cacheInstance !== NULL && is_object($this->cacheInstance)) {
                /**
                 * @var $cache object
                 */
                $cache = $this->cacheInstance->getItem($key);
                if (!$cache->isHit()) {
                    return FALSE;
                } else {
                    return TRUE;
                }
            } else {
                $this->debug->error(__FUNCTION__, 'Unavailable cacheInstance');

                return FALSE;
            }
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->debug->error(__FUNCTION__, $message);

            return $message;
        }
    }
1286337
public function cache()
    {
        $this->cache->remember($this->getCacheKey(), $this->getCacheLifetime(), function () {
            return $this->scan();
        });
    }
1289430
public function loadConfigurationCache(): bool
    {
        $cachePathAndFilename = $this->constructConfigurationCachePath();
        $configurations = @include $cachePathAndFilename;
        if ($configurations !== false) {
            $this->configurations = $configurations;
            return true;
        }

        return false;
    }
69348
public function has($key)
    {
        return $this->enabled && $this->filesystem->exists($this->cacheDir.$key);
    }
1123642
public final function is_visible() {
        if ($this->visiblecache === null) {
            $disabled = get_config($this->get_subtype() . '_' . $this->get_type(), 'disabled');
            $this->visiblecache = !$disabled;
        }
        return $this->visiblecache;
    }
798580
private function saveData(): bool
    {
        if ($cacheTime = $this->getMeta()->getCache()) {
            return Cache::set(
                $this->key,
                $this->getData(),
                $cacheTime,
                ['system', 'data']
            );
        }
        return false;
    }
147287
public function exists(): bool
    {
        if ($this->caching == false) {
            return file_exists($this->getAbsoluteFilePath());
        }

        if ($this->exists == null) {
            $this->exists = file_exists($this->getAbsoluteFilePath());
        }

        return $this->exists;
    }
399949
public function getCached()
    {
        $cache = $this->cache->get('config');
        if ($cache === false) {
            $cache = $this->notCached;
            $this->cache->set('config', $cache);
        }
        return $cache;
    }
987415
public function isCached() {
    $cache = ObjectFactory::getInstance('staticCache');
    return $this->id == self::NO_CACHE ? false :
            $cache->exists(self::getCacheSection($this->type), self::getCacheId($this->id));
  }
355146
public function needsReload()
    {
        if ($this->reload) {
            return true;
        }

        // will reload tld list if timestamp of cache file is outdated
        if (time() - $this->tldList['timestamp'] > $this->cacheTime) {
            return true;
        }

        // will reload tld list if changes to Additional.php have been made
        if ($this->tldList['timestamp'] < filemtime(__DIR__ .'/Additional.php')) {
            return true;
        }

        return false;
    }
1277741
public function isCacheActual() {

        if ( !isset($this->latestCachingTime) ) {
            return false;
        }

        return
            ( (time() - $this->latestCachingTime)
              > self::ONE_DAY_IN_SECONDS );
    }
536315
protected function _isCacheValid()
    {
        if (null === $this->_etag) {
            // lmTime is copied to ETag, so this condition implies that the
            // server sent neither ETag nor Last-Modified, so the client can't
            // possibly has a valid cache.
            return false;
        }
        $isValid = ($this->resourceMatchedEtag() || $this->resourceNotModified());
        if ($isValid) {
            $this->_headers['_responseCode'] = 'HTTP/1.0 304 Not Modified';
        }

        return $isValid;
    }
1046622
private function isCacheUpToDate()
    {
        if (!file_exists($this->cachedFile)) {
            return false;
        }

        $cacheTime  = filemtime($this->cachedFile);
        $configTime = max(filemtime($this->configPath), filemtime($this->envFile));

        return $cacheTime == $configTime;
    }
679426
public function hasCacheFrontendFactory() {
		if ($this->_cacheFrontendFactory !== null) {
			return true;
		}
		
		if ($this instanceof LocatorAwareInterface
		 && $this->hasLocator()
		 && $this->getLocator()->has($this->getCacheFrontendFactoryServiceId())) {
			return true;
		}
		
		return false;
	}
581203
public function enableCaching()
    {
        if (FileSystemHelper::folderExists($this->getCacheDir())) {
            $this->caching = true;
            return true;
        }
        return false;
    }