CacheFile class

Class to manage individual cache files

Each cache file creates it's own directory based on the '$id' given. The dir is created so that secondary cache files can be created too, and these are automatically removed when the remove() method is called.

This file is licensed under the MIT license


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the CacheFile class also inherits all the methods and properties of: Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
CacheFile::exists()
bool

Does the cache file exist?

 
CacheFile::expireAll()
None

Causes all cache files in this type to be immediately expired

 
CacheFile::get()
string

Get the contents of the cache based on the primary or secondary ID

 
CacheFile::remove()
None

Removes all cache files for primaryID

 
CacheFile::removeAll(string $path)
int

Remove all cache files in the given path, recursively

 
CacheFile::save(string $data)
bool

Saves $data to the cache

 
CacheFile::setChmodDir(string $mode)
None

Set the octal mode for dirs created by CacheFile

 
CacheFile::setChmodFile(string $mode)
None

Set the octal mode for files created by CacheFile

 
CacheFile::setSecondaryID($id)
None

An extra part to be appended to the filename

 

Additional methods and properties

In addition to the methods and properties above, CacheFile also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.255