src/Cache/FileCache.php
public function generateCacheName(string $identifier = '', string $prefix = '', bool $more_entropy = true, string $fileExtension = '')
    {
        if (empty($identifier)) {
            $fileName = uniqid($prefix, $more_entropy);
        } else {
            $fileName = $this->getCacheFileName($identifier);
        }

        if (!empty($fileExtension)) {
            $fileName .= '.'.$fileExtension;
        }

        return $fileName;
    }
public function generateCacheName(string $identifier = '', string $prefix = '', bool $more_entropy = true, string $fileExtension = '')
    {
        if (empty($identifier)) {
            $fileName = uniqid($prefix, $more_entropy);
        } else {
            $fileName = $this->getCacheFileName($identifier);
        }

        if (!empty($fileExtension)) {
            $fileName .= '.'.$fileExtension;
        }

        return $fileName;
    }
public function generateCacheName ( string $ identifier = '' , string $ prefix = '' , bool $ more_entropy = true , string $ fileExtension = '' ) { if ( empty ( $ identifier ) ) { $ fileName = uniqid ( $ prefix , $ more_entropy ) ; } else { $ fileName = $ this -> getCacheFileName ( $ identifier ) ; } if ( ! empty ( $ fileExtension ) ) { $ fileName .= '.' . $ fileExtension ; } return $ fileName ; }
Generate a file name for cache.

If a identifier is given, you get the resulting file name.
If no identifier is given, if will return a unique file name without extension.

@param string $identifier    An identifier for the cache. For example be the source file name or path. If empty, a unique filename will be generated.
@param string $prefix        Adds a prefix to the generated name. Only if $identifier is empty.
@param bool   $more_entropy  A longer name for the unique filename. Only if $identifier is empty. Default
@param string $fileExtension optional: If set, the file extension will be appended to the generated file name

@return string a unique filename for caching
Generate a file name for cache .