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

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

        if ($file->exists()) {
            return true;
        }

        return false;
    }
public function exist(string $identifier, string $fileExtension = '')
    {
        $fileName = $this->getCacheFileName($identifier);
        $cachePath = $this->cacheFolderWithNamespace.'/'.$fileName;

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

        if ($file->exists()) {
            return true;
        }

        return false;
    }
public function exist ( string $ identifier , string $ fileExtension = '' ) { $ fileName = $ this -> getCacheFileName ( $ identifier ) ; $ cachePath = $ this -> cacheFolderWithNamespace . '/' . $ fileName ; if ( ! empty ( $ fileExtension ) ) { $ cachePath .= '.' . $ fileExtension ; } $ file = new File ( $ cachePath ) ; if ( $ file -> exists ( ) ) { return true ; } return false ; }
Checks if a cached file already exist in cache. Namespace is taken into account.


@param string $identifier    The identifier
@param string $fileExtension If not set, a file with no file extension is searched

@throws \Exception

@return bool
Checks if a cached file already exist in cache . Namespace is taken into account .