Lines Matching defs:cache
16 public $ext = ''; // file ext for cache data, secondary identifier for this item
17 public $cache = ''; // cache file name
18 public $depends = []; // array containing cache dependency information,
19 // used by makeDefaultCacheDecision to determine cache validity
27 protected $_nocache = false; // if set to true, cache will not be used or stored
38 $this->cache = getCacheName($key, $ext);
64 * public method to determine whether the cache can be used
66 * to assist in centralisation of event triggering and calculation of cache statistics,
69 * @param array $depends array of cache dependencies, support dependecies:
70 * 'age' => max age of the cache in seconds
71 * 'files' => cache must be younger than mtime of each file
74 * @return bool true if cache can be used, false otherwise
95 * internal method containing cache use decision logic
99 * age - expire cache if older than age (seconds)
100 * files - expire cache if any file in this array was updated more recently than the cache
118 if (!($this->_time = @filemtime($this->cache))) {
120 } // cache exists?
122 // cache too old?
131 } // cache older than files it depends on?
157 * @return string cache contents
161 return io_readFile($this->cache, $clean);
165 * cache $data
176 return io_saveFile($this->cache, $data);
180 * remove any cached data associated with this cache instance
184 @unlink($this->cache);
188 * Record cache hits statistics.
191 * @param bool $success result of this cache use attempt