PHP Класс Imbo\EventListener\ImageTransformationCache

Event listener that stores transformed images to disk. By using this listener Imbo will only have to generate each transformation once. The listener is also responsible for deleting images from the cache when the original images are deleted through the API. The values used to generate the unique cache key for each image are: - user - image identifier - normalized accept header - image extension (can be null) - image transformations (can be null)
Автор: Christer Edvartsen ([email protected])
Наследование: implements Imbo\EventListener\ListenerInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $params ) Class constructor
deleteFromCache ( Imbo\EventManager\EventInterface $event ) Delete cached images from the cache
getSubscribedEvents ( )
loadFromCache ( Imbo\EventManager\EventInterface $event ) Load transformed images from the cache
storeInCache ( Imbo\EventManager\EventInterface $event ) Store transformed images in the cache

Приватные методы

Метод Описание
getCacheDir ( string $user, string $imageIdentifier ) : string Get the path to the current image cache dir
getCacheFilePath ( Request $request ) : string Get the absolute path to response in the cache
getCacheKey ( Request $request ) : string Generate a cache key
isWritable ( string $path ) : boolean Check whether or not a directory (or its parent) is writable
rmdir ( string $dir ) Completely remove a directory (with contents)

Описание методов

__construct() публичный Метод

Class constructor
public __construct ( array $params )
$params array Parameters for the cache

deleteFromCache() публичный Метод

Delete cached images from the cache
public deleteFromCache ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event

getSubscribedEvents() публичный статический Метод

public static getSubscribedEvents ( )

loadFromCache() публичный Метод

Load transformed images from the cache
public loadFromCache ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event

storeInCache() публичный Метод

Store transformed images in the cache
public storeInCache ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event