Validates that the configured cache directory exists and is writeable and returns some details about its configuration if that's the case

@return Result
@api
492717
public function getStatus(): Result
    {
        $result = new Result();
        try {
            $this->verifyCacheDirectory();
        } catch (Exception $exception) {
            $result->addError(new Error($exception->getMessage(), $exception->getCode(), [], 'Cache Directory'));
            return $result;
        }
        $result->addNotice(new Notice($this->baseDirectory ?? '-', null, [], 'Base Directory'));
        $result->addNotice(new Notice($this->getCacheDirectory(), null, [], 'Cache Directory'));
        return $result;
    }
1260600
protected function makeCacheableDir()
    {
        if ($this->configure['cache']) {
            $this->makeDirectories(strval($this->configure['cache_dir']), 0775);
            $this->cacheable = true;
        }
    }
836389
public function checkConfigDir()
    {
        if (is_writable(dirname(__FILE__) . '/../../../config'))
            return true;
        
        $this->addError('isConfigDirWritable', Yii::t('Install.main','Configuration directory is not writable. This must be corrected before your settings can be applied.'));
        return false;
    }
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));
  }
1204784
protected function validateOutputDirectoryPermissions()
    {
        if (!is_dir($this->outputDirectory)) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\OutputDirectoryValidationException(
                'The directory "' . $this->outputDirectory . '" where the class files have to be written to' .
                ' does not exist. ' .
                'Please create the directory "' . $this->outputDirectory . '" with write permissions for the user "' . get_current_user() . '" ' .
                'and run this script again',
                static::ERROR_CODE_DIRECTORY_CREATION_ERROR
            );
        } elseif (!is_writable($this->outputDirectory)) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\OutputDirectoryValidationException(
                'The directory "' . realpath($this->outputDirectory) . '" where the class files have to be written to' .
                ' is not writable for user "' . get_current_user() . '". ' .
                'Please fix the permissions on this directory ' .
                'and run this script again',
                static::ERROR_CODE_DIRECTORY_CREATION_ERROR
            );
        }
    }
1171677
protected function checkCacheDir()
    {
        if (!is_dir($this->getCachePath()) && !mkdir($this->getCachePath(), 0775, true)) {
            throw new RunBBException('Unable to create cache directory ' . $this->getCachePath());
        } elseif (!is_readable($this->getCachePath()) || !is_writable($this->getCachePath())) {
            if (!chmod($this->getCachePath(), 0775)) {
                throw new RunBBException($this->getCachePath() . ' must be readable and writeable');
            }
        }
        return true;
    }
1054476
function is_cached( $path, $method = 'GET', $params = array() ) {
			$cache_key = $this->get_cache_key( $path, $method, $params );

			return self::$_cache->has_valid( $cache_key );
		}
690222
private function getCacheFiles()
    {
        if (!($files = @scandir($this->directory, 1))) {
            return false;
        }

        $negExtLen = -1 * strlen($this->extension);
        $return = array();
        foreach ($files as $file) {
            if (substr($file, $negExtLen) === $this->extension) {
                $return[] = $this->directory . '/' . $file;
            }
        }
        return $return;
    }
556899
public static function isAvailable()
	{
		$conf = new \Hubzero\Config\Repository('site');
		return is_writable($conf->get('cache_path', PATH_APP . DIRECTORY_SEPARATOR . 'cache'));
	}
208565
public static function getTemporaryDirectory()
    {
        $check = function ($s) {
            $result = '';
            if (is_string($s) && ($s !== '')) {
                $s = @realpath($s);
                if (($s !== false) && is_dir($s) && is_writable(($s))) {
                    $result = $s;
                }
            }

            return $result;
        };
        $result = '';
        if ($result === '') {
            if (static::$temporaryDirectory !== '') {
                $result = $check(static::$temporaryDirectory);
                if ($result === '') {
                    throw new \Exception('The configured temporary directory is not valid');
                }
            }
        }
        if ($result === '') {
            if (function_exists('sys_get_temp_dir')) {
                $result = $check(@sys_get_temp_dir());
            }
        }
        if ($result === '') {
            if (isset($_ENV) && is_array($_ENV)) {
                foreach (array('TMP', 'TMPDIR', 'TEMP') as $k) {
                    if (isset($_ENV[$k])) {
                        $result = $check($_ENV[$k]);
                        if ($result !== '') {
                            break;
                        }
                    }
                }
            }
        }
        if ($result === '') {
            throw new \Exception('Unable to determine a temporary directory');
        }

        return $result;
    }
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;
    }
1089022
public function canCache()
    {
        // Check if the response is cacheable based on the code
        if (!in_array((int) $this->getStatusCode(), self::$cacheResponseCodes)) {
            return false;
        }

        // Make sure a valid body was returned and can be cached
        if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable())
            && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) {
            return false;
        }

        // Never cache no-store resources (this is a private cache, so private
        // can be cached)
        if ($this->getHeader('Cache-Control') && $this->getHeader('Cache-Control')->hasDirective('no-store')) {
            return false;
        }

        return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
    }
1361127
public function getCache() 
    {

        // make sure filters are parsed again if cache expired
        if (file_exists($this->path) && (time()-filectime($this->path)) < 
            $this->config['expiration_time']) {
            $data = unserialize(file_get_contents($this->path));
              return $data;
        }

        return false;
    }
186906
public function createCache()
    {
        // Check if there are files in the cache.
        // If not we will fill the cache, if there are we will check if there have been any changes to the enforced dirs
        $fileIterator = new \FilesystemIterator($this->getConfig()->getValue('cache/dir'), \FilesystemIterator::SKIP_DOTS);
        if (iterator_count($fileIterator) <= 1 || $this->getConfig()->getValue('environment') === 'development') {
            // Fill the cache
            $this->fillCache();

        } else {
            if (!$this->structureMap->isRecent()) {
                $this->refillCache();
            }
        }
    }
872453
public function getCacheDirectory()
    {
        $dir = $this->cacheBaseDir.'/RatingServicesCache/';
        if (!file_exists($dir)) {
            mkdir($dir, 0777, true);
            if (!file_exists($dir)) {
                $dir = null;
            }
        }
        if (!is_dir($dir) || !is_writable($dir)) {
            $dir = null;
        }

        return $dir;
    }
869648
function isCached()
    {
        $file = $this->cache_dir . '/' . base64_encode($_SERVER['REQUEST_URI']) . '.html';
        if (!file_exists($file))
        {
            return false;
        }
        elseif (filemtime($file) + $this->expire < time())
        {
            return false;
        }
        else
        {
            return true;
        }
    }
183749
public function canWriteRoutes()
    {
        if (!is_null($this->bCanWriteRoutes)) {
            return $this->bCanWriteRoutes;
        }

        //  First, test if file exists, if it does is it writable?
        if (file_exists(static::ROUTES_DIR . static::ROUTES_FILE)) {

            if (is_writable(static::ROUTES_DIR . static::ROUTES_FILE)) {

                $this->bCanWriteRoutes = true;
                return true;

            } else {

                //  Attempt to chmod the file
                if (@chmod(static::ROUTES_DIR . static::ROUTES_FILE, FILE_WRITE_MODE)) {

                    $this->bCanWriteRoutes = true;
                    return true;

                } else {

                    $this->setError('The route config exists, but is not writable.');
                    $this->bCanWriteRoutes = false;
                    return false;
                }
            }

        } elseif (is_writable(static::ROUTES_DIR)) {

            $this->bCanWriteRoutes = true;
            return true;

        } else {

            //  Attempt to chmod the directory
            if (@chmod(static::ROUTES_DIR, DIR_WRITE_MODE)) {

                $this->bCanWriteRoutes = true;
                return true;

            } else {

                $this->setError('The route directory is not writable. <small>' . static::ROUTES_DIR . '</small>');
                $this->bCanWriteRoutes = false;
                return false;
            }
        }
    }