PHP Class Minify_Cache_File, minify

Inheritance: implements Minify_CacheInterface
Show file Open project: mrclay/minify Class Usage Examples

Public Methods

Method Description
__construct ( string $path = '', boolean $fileLocking = false, Psr\Log\LoggerInterface $logger = null )
display ( string $id ) Send the cached content to output
fetch ( string $id ) : string Fetch the cached content
getPath ( ) : string Fetch the cache path used
getSize ( string $id ) : integer Get the size of a cache entry
isValid ( string $id, integer $srcMtime ) : boolean Does a valid cache entry exist?
store ( string $id, string $data ) : boolean Write data to cache.
tmp ( ) : string Get a usable temp directory

Protected Methods

Method Description
_log ( string $msg ) : null Send message to the Minify logger

Method Details

__construct() public method

public __construct ( string $path = '', boolean $fileLocking = false, Psr\Log\LoggerInterface $logger = null )
$path string
$fileLocking boolean
$logger Psr\Log\LoggerInterface

_log() protected method

Send message to the Minify logger
Deprecation: Use $this->logger
protected _log ( string $msg ) : null
$msg string
return null

display() public method

Send the cached content to output
public display ( string $id )
$id string cache id (e.g. a filename)

fetch() public method

Fetch the cached content
public fetch ( string $id ) : string
$id string cache id (e.g. a filename)
return string

getPath() public method

Fetch the cache path used
public getPath ( ) : string
return string

getSize() public method

Get the size of a cache entry
public getSize ( string $id ) : integer
$id string cache id (e.g. a filename)
return integer size in bytes

isValid() public method

Does a valid cache entry exist?
public isValid ( string $id, integer $srcMtime ) : boolean
$id string cache id (e.g. a filename)
$srcMtime integer mtime of the original source file(s)
return boolean exists

store() public method

Write data to cache.
public store ( string $id, string $data ) : boolean
$id string cache id (e.g. a filename)
$data string
return boolean success

tmp() public static method

Get a usable temp directory
Deprecation:
public static tmp ( ) : string
return string