caching\FileCache getCacheFile()

getCacheFile() protected method Returns the cache file path given the cache key. protected string getCacheFile ( $key )$key string Cache key return string The cache file path

caching\FileCache gcRecursive()

gcRecursive() protected method Recursively removing expired cache files under a directory. This method is mainly used by gc(). protected void gcRecursive ( $path, $expiredOnly )$path string The directory under which expired cache files are removed. $expiredOnly boolean Whether to only remove expired cache files. If false, all files under $path will be removed.

caching\FileCache gc()

gc() public method Removes expired cache files. public void gc ( $force = false, $expiredOnly = true )$force boolean Whether to enforce the garbage collection regardless of $gcProbability. Defaults to false, meaning the actual deletion happens with the probability as specified by $gcProbability. $expiredOnly boolean Whether to removed expired cache files only. If false, all cache files under $cachePath will be removed.

caching\FileCache flushValues()

flushValues() protected method Deletes all values from cache. This is the implementation of the method declared in the parent class. protected boolean flushValues ( )return boolean Whether the flush operation was successful.

caching\FileCache exists()

exists() public method Checks whether a specified key exists in the cache. This can be faster than getting the value from the cache if the data is big. Note that this method does not check whether the dependency associated with the cached data, if there is any, has changed. So a call to get() may return false while exists returns true. public boolean exists ( $key )$key mixed A key identifying the cached value. This can be a simple string or a complex data structure consisting of factors

caching\FileCache deleteValue()

deleteValue() protected method Deletes a value with the specified key from cache This is the implementation of the method declared in the parent class. protected boolean deleteValue ( $key )$key string The key of the value to be deleted return boolean If no error happens during deletion

caching\FileCache addValue()

addValue() protected method Stores a value identified by a key into cache if the cache does not contain this key. This is the implementation of the method declared in the parent class. protected boolean addValue ( $key, $value, $duration )$key string The key identifying the value to be cached $value string The value to be cached. Other types (if you have disabled $serializer) unable to get is correct in getValue(). $duration integer The number of seconds in which the cached value wil

caching\FileCache $keyPrefix

$keyPrefix public property A string prefixed to every cache key. This is needed when you store cache data under the same $cachePath for different applications to avoid conflict. To ensure interoperability, only alphanumeric characters should be used. public string $keyPrefix = ''

caching\FileCache $gcProbability

$gcProbability public property The probability (parts per million) that garbage collection (GC) should be performed when storing a piece of data in the cache. Defaults to 10, meaning 0.001% chance. This number should be between 0 and 1000000. A value 0 means no GC will be performed at all. public integer $gcProbability = 10

caching\FileCache $fileMode

$fileMode public property The permission to be set for newly created cache files. This value will be used by PHP chmod() function. No umask will be applied. If not set, the permission will be determined by the current environment. public integer $fileMode = null