class TileCache

The image tile cache.

Properties

protected string $path Directory of the image cache.

Methods

__construct()

Create an instance.

mixed
get(Image $image)

Cache image tiles for an image if they are not alerady cached.

prune()

Remove old cached image tiles if the cache got bigger than the allowed size.

clear()

Delete all cached tiles.

ensureDirectoryExists(string $cachedPath)

Creates the subdirectories that are required by the given path to the cached tiles.

int
getDirectorySize(string $dir)

Returns the size of the directory and all contents in bytes.

Details

at line 28
__construct()

Create an instance.

at line 40
mixed get(Image $image)

Cache image tiles for an image if they are not alerady cached.

Parameters

Image $image

Return Value

mixed Path to the cached image tile directory or false if the image tiles do not exist.

at line 79
prune()

Remove old cached image tiles if the cache got bigger than the allowed size.

at line 116
clear()

Delete all cached tiles.

at line 136
protected ensureDirectoryExists(string $cachedPath)

Creates the subdirectories that are required by the given path to the cached tiles.

Parameters

string $cachedPath

at line 148
protected int getDirectorySize(string $dir)

Returns the size of the directory and all contents in bytes.

Parameters

string $dir

Return Value

int