FileCacheFake
class FileCacheFake implements FileCache
Methods
No description
Perform a callback with the paths of many cached files. Use this to prevent pruning of the files while they are processed.
Like batch
but deletes the cached files afterwards (if they are not used
somewhere else).
Remove cached files that are too old or exceed the maximum cache size.
Delete all unused cached files.
Details
at line 11
__construct()
No description
at line 23
mixed
get(File $file, callable $callback, bool $throwOnLock = false)
Perform a callback with the path of a cached file. This takes care of shared locks on the cached file file so it is not corrupted due to concurrent write operations.
at line 33
mixed
getOnce(File $file, callable $callback, bool $throwOnLock = false)
Like get
but deletes the cached file afterwards (if it is not used somewhere
else).
at line 41
resource
getStream(File $file)
Get a stream resource for an file. If the file is cached, the resource points to the cached file instead. This will not cache uncached files. Make sure to close the streams!
at line 53
mixed
batch(array $files, callable $callback, bool $throwOnLock = false)
Perform a callback with the paths of many cached files. Use this to prevent pruning of the files while they are processed.
at line 67
mixed
batchOnce(array $files, callable $callback, bool $throwOnLock = false)
Like batch
but deletes the cached files afterwards (if they are not used
somewhere else).
at line 75
prune()
Remove cached files that are too old or exceed the maximum cache size.
at line 83
clear()
Delete all unused cached files.
at line 91
bool
exists(File $file)
Check if a file exists.