class Cache (View source)

Reads/writes to a filesystem cache

Methods

__construct(IOInterface $io, string $cacheDir, string $whitelist = 'a-z0-9.', Filesystem $filesystem = null)

No description

isEnabled()

No description

getRoot()

No description

read($file)

No description

write($file, $contents)

No description

copyFrom($file, $source)

Copy a file into the cache

copyTo($file, $target)

Copy a file out of the cache

gcIsNecessary()

No description

remove($file)

No description

clear()

No description

gc($ttl, $maxSize)

No description

sha1($file)

No description

sha256($file)

No description

getFinder()

No description

Details

__construct(IOInterface $io, string $cacheDir, string $whitelist = 'a-z0-9.', Filesystem $filesystem = null)

Parameters

IOInterface $io
string $cacheDir location of the cache
string $whitelist List of characters that are allowed in path names (used in a regex character class)
Filesystem $filesystem optional filesystem instance

isEnabled()

getRoot()

read($file)

Parameters

$file

write($file, $contents)

Parameters

$file
$contents

copyFrom($file, $source)

Copy a file into the cache

Parameters

$file
$source

copyTo($file, $target)

Copy a file out of the cache

Parameters

$file
$target

gcIsNecessary()

remove($file)

Parameters

$file

clear()

gc($ttl, $maxSize)

Parameters

$ttl
$maxSize

sha1($file)

Parameters

$file

sha256($file)

Parameters

$file

protected getFinder()