Lines Matching full:cache
21 * Path to package list cache file
23 * @var string $cache
25 private $cache; variable in helper_plugin_poldek
31 * We create two cache objects, one for updating indexes, which is mtime based
35 * Without force, cache is attempted to be used, even if it's stale
41 if ($this->cache) {
47 $idx_cache = new cache($this->getPluginName(), '.idx');
48 $pkg_cache = new cache($this->getPluginName(), '.txt');
49 $cache_exists = file_exists($pkg_cache->cache);
54 // cache is ok, if it exists and is not empty and does not contain errors
55 …ache_ok = $cache_exists && filesize($pkg_cache->cache) && !preg_grep('/^error:/', file($pkg_cache-…
57 // without force update indexes only if cache is missing
61 // Writing /root/.poldek-cache/[...]/packages.ndir.gz...
69 touch($idx_cache->cache);
71 // sleep, so packages cache be newer
75 touch($pkg_cache->cache);
81 // do not update listing, if cache exists and not in cron mode
82 …if (($force || !$cache_exists) && !$pkg_cache->useCache(array('files' => array($idx_cache->cache))…
84 // write cache, unless there was an error
90 $this->cache = $pkg_cache->cache;
94 static $cache;
96 if (!$cache) {
97 $cache = array();
100 // cache this for cases having more than one instance of our plugin on page
103 $cache[$m['name']] = $line;
105 $cache[$m['name']] = $line;
110 if (isset($cache[$package])) {
111 return $cache[$package];
119 * It ensures that cache file is created, if missing
123 return $this->cache;