Ejemplo n.º 1
0
 /**
  * @param string $file
  *
  * @return array
  */
 protected function getEntriesFromCache($file)
 {
     $identifier = $this->getCacheIdentifier($file);
     return $this->cache->rememberForever($identifier, function () use($file) {
         return $this->getEntriesFromCsv($file);
     });
 }
Ejemplo n.º 2
0
 /**
  * @param $method string the methode name of the parent method
  * @param $args array the method parameters
  * @return mixed
  */
 protected function _cachedOrFromParent($method, $args)
 {
     $cacheKey = $this->getCacheKey([get_called_class() . '::' . $method, serialize($args)]);
     if ($this->_cache->has($cacheKey)) {
         $ret = $this->_cache->get($cacheKey);
     } else {
         $ret = call_user_func_array(array('parent', $method), $args);
         $this->_cache->forever($cacheKey, $ret);
     }
     return $ret;
 }
Ejemplo n.º 3
0
 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param  string   $key
  * @param  \Closure  $callback
  * @return mixed
  */
 public function rememberForever($key, Closure $callback)
 {
     if (is_array($key)) {
         return $this->rememberManyForever($key, $callback);
     }
     return parent::rememberForever($key, $callback);
 }
 /**
  * Store an item in the cache indefinitely.
  *
  * @param  string $key
  * @param  mixed $value
  * @return void
  */
 public function forever($key, $value)
 {
     $this->sendTagsToStore();
     parent::forever($key, $value);
 }