src/Cache/FileCache.php
public function get(string $identifier, string $fileExtension = '', callable $saveCallback = null)
    {
        $fileName = $this->getCacheFileName($identifier);
        $cachePath = $this->cacheFolderWithNamespace.'/'.$fileName;

        if (!empty($fileExtension)) {
            $fileName .= '.'.$fileExtension;
            $cachePath .= '.'.$fileExtension;
        }
        $file = new File($cachePath);

        if (!$file->exists()) {
            if (null !== $saveCallback) {
                if ($saveCallback($identifier, $this->cacheFolderWithNamespace, $fileName)) {
                    return $this->cacheFolderWithNamespace.'/'.$fileName;
                }
            }

            return false;
        }

        return $file->path;
    }
public function get(string $identifier, string $fileExtension = '', callable $saveCallback = null)
    {
        $fileName = $this->getCacheFileName($identifier);
        $cachePath = $this->cacheFolderWithNamespace.'/'.$fileName;

        if (!empty($fileExtension)) {
            $fileName .= '.'.$fileExtension;
            $cachePath .= '.'.$fileExtension;
        }
        $file = new File($cachePath);

        if (!$file->exists()) {
            if (null !== $saveCallback) {
                if ($saveCallback($identifier, $this->cacheFolderWithNamespace, $fileName)) {
                    return $this->cacheFolderWithNamespace.'/'.$fileName;
                }
            }

            return false;
        }

        return $file->path;
    }
public function get ( string $ identifier , string $ fileExtension = '' , callable $ saveCallback = null ) { $ fileName = $ this -> getCacheFileName ( $ identifier ) ; $ cachePath = $ this -> cacheFolderWithNamespace . '/' . $ fileName ; if ( ! empty ( $ fileExtension ) ) { $ fileName .= '.' . $ fileExtension ; $ cachePath .= '.' . $ fileExtension ; } $ file = new File ( $ cachePath ) ; if ( ! $ file -> exists ( ) ) { if ( null !== $ saveCallback ) { if ( $ saveCallback ( $ identifier , $ this -> cacheFolderWithNamespace , $ fileName ) ) { return $ this -> cacheFolderWithNamespace . '/' . $ fileName ; } } return false ; } return $ file -> path ; }
Get the file path for the given identifier. Namespace is taken into account.

@param string   $identifier
@param string   $fileExtension
@param callable $saveCallback  A callback handles the file save functionality. Get filepath, filename and the identifier as parameter. Expects a boolean return value.

@throws \Exception

@return bool|string returns the path of the cached file or false, if cached file could not be found
Get the file path for the given identifier . Namespace is taken into account .