PHP Class Webiny\Component\Rest\Compiler\Cache

Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Webiny\Component\Rest\Compiler\CacheDrivers\CacheDriverInterface $cacheDriver ) Base constructor.
deleteCache ( $api, $class )
getCacheContent ( $api, $class, $version ) : array Returns the contents of an existing cache file in form of an array.
isCacheValid ( string $api, string $class ) : boolean Checks if a cache file is valid.
writeCacheFile ( $api, $class, $version, $cacheArray ) Save the compiled cache array.

Method Details

__construct() public méthode

Base constructor.
public __construct ( Webiny\Component\Rest\Compiler\CacheDrivers\CacheDriverInterface $cacheDriver )
$cacheDriver Webiny\Component\Rest\Compiler\CacheDrivers\CacheDriverInterface

deleteCache() public méthode

public deleteCache ( $api, $class )
$api Name of the API.
$class Name of the class.

getCacheContent() public méthode

Returns the contents of an existing cache file in form of an array.
public getCacheContent ( $api, $class, $version ) : array
$api Name of the API.
$class Name of the class.
$version Version of the class.
Résultat array

isCacheValid() public méthode

A valid file is considered and existing cache file that has a newer creation time, than the modify time, of an api class that the cache file belongs to.
public isCacheValid ( string $api, string $class ) : boolean
$api string Name of the rest api configuration.
$class string Fully qualified class name.
Résultat boolean True if cache file is valid, otherwise false.

writeCacheFile() public méthode

Save the compiled cache array.
public writeCacheFile ( $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.