예제 #1
0
 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param  string   $key
  * @param  \Closure $callback
  *
  * @return mixed
  */
 public function sear($key, Closure $callback)
 {
     if ($this->enabled) {
         return $this->cache->sear($key, $callback);
     }
     return $callback;
 }
예제 #2
0
 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param string $key
  * @param \Closure $callback
  * @return mixed 
  * @static 
  */
 public static function sear($key, $callback)
 {
     return \Illuminate\Cache\Repository::sear($key, $callback);
 }
예제 #3
0
 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param  string   $key
  * @param  \Closure  $callback
  * @return mixed
  */
 public function sear($key, Closure $callback)
 {
     if (is_array($key)) {
         return $this->searMany($key, $callback);
     }
     return parent::sear($key, $callback);
 }