Minify_CacheInterface::store PHP Method

store() public method

Write data to cache.
public store ( string $id, string $data ) : boolean
$id string cache id (e.g. a filename)
$data string
return boolean success
    public function store($id, $data);

Usage Example

Esempio n. 1
0
 /**
  * Get lessphp cache object
  *
  * @return array
  */
 private function getCache()
 {
     // cache for single run
     // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)
     if (isset($this->parsed)) {
         return $this->parsed;
     }
     // check from cache first
     $cache = null;
     $cacheId = $this->getCacheId();
     if ($this->cache->isValid($cacheId, 0)) {
         if ($cache = $this->cache->fetch($cacheId)) {
             $cache = unserialize($cache);
         }
     }
     $less = $this->getCompiler();
     $input = $cache ? $cache : $this->filepath;
     $cache = $less->cachedCompile($input);
     if (!is_array($input) || $cache['updated'] > $input['updated']) {
         $this->cache->store($cacheId, serialize($cache));
     }
     return $this->parsed = $cache;
 }
All Usage Examples Of Minify_CacheInterface::store