PHP Class Webiny\Component\Rest\Compiler\CacheDrivers\FilesystemDriver

Inheritance: implements Webiny\Component\Rest\Compiler\CacheDrivers\CacheDriverInterface, use trait Webiny\Component\StdLib\StdLibTrait
Afficher le fichier Open project: Webiny/Framework

Méthodes publiques

Méthode Description
delete ( $api, $class ) Delete the cache for the given api and class.
isFresh ( $api, $class, $version, $ttl ) : boolean Checks if the cache is still fresh based on the given ttl.
read ( $api, $class, $version ) : array | boolean Read the compiled cache array.
save ( $api, $class, $version, $cacheArray ) Save the compiled cache array.

Private Methods

Méthode Description
getCacheFilename ( string $api, string $class, string $version ) : string Returns the name of the cached class file.
getCacheFolder ( string $api, string $class ) : string Returns the folder where the cache files should be stored.

Method Details

delete() public méthode

Delete the cache for the given api and class.
public delete ( $api, $class )
$api Name of the API.
$class Name of the class.

isFresh() public méthode

Checks if the cache is still fresh based on the given ttl.
public isFresh ( $api, $class, $version, $ttl ) : boolean
$api Name of the API.
$class Name of the class.
$version Version of the class.
$ttl Unix timestamp against which the cache ttl should be compared.
Résultat boolean Returns true if cache is till fresh, otherwise false.

read() public méthode

Read the compiled cache array.
public read ( $api, $class, $version ) : array | boolean
$api Name of the API.
$class Name of the class.
$version Version of the class.
Résultat array | boolean Returns the compiled cache array, or false if cache is not found.

save() public méthode

Save the compiled cache array.
public save ( $api, $class, $version, $cacheArray )
$api Name of the API.
$class Name of the class.
$version Version of the class.
$cacheArray The compiled class cache array.