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
파일 보기 프로젝트 열기: imbo/imbo 1 사용 예제들

공개 메소드들

메소드 설명
__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