當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cache\CacheManager類代碼示例

本文整理匯總了PHP中Illuminate\Cache\CacheManager的典型用法代碼示例。如果您正苦於以下問題:PHP CacheManager類的具體用法?PHP CacheManager怎麽用?PHP CacheManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CacheManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 /**
  * Handle the command.
  *
  * @param CacheManager       $cache
  * @param FieldMigrator      $fields
  * @param StreamMigrator     $streams
  * @param AssignmentMigrator $assignments
  */
 public function handle(CacheManager $cache, FieldMigrator $fields, StreamMigrator $streams, AssignmentMigrator $assignments)
 {
     $assignments->reset($this->migration);
     $fields->reset($this->migration);
     $streams->reset($this->migration);
     $cache->flush();
 }
開發者ID:huglester,項目名稱:streams-platform,代碼行數:15,代碼來源:Reset.php

示例2: addFileCacheDriver

 protected function addFileCacheDriver(CacheManager $cacheManager)
 {
     $cacheManager->extend(static::$fileDriverName, function ($app, array $cacheConfig) use($cacheManager) {
         $store = new AlternativeHierarchialFileCacheStore(new Filesystem(static::makeFileCacheAdapter($cacheConfig)), static::getPrefix($cacheConfig));
         return $cacheManager->repository($store);
     });
 }
開發者ID:swayok,項目名稱:alternative-laravel-cache,代碼行數:7,代碼來源:AlternativeCacheStoresServiceProvider.php

示例3: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot(CacheManager $cacheManager)
 {
     $cacheManager->extend('dummy', function ($app) {
         $prefix = $app['config']->get('cache.prefix');
         return $app['cache']->repository(new DummyCacheStore($prefix));
     });
 }
開發者ID:assurrussa,項目名稱:dummy-cache,代碼行數:12,代碼來源:DummyCacheServiceProvider.php

示例4: cache

 /**
  * Return the cache instance with tags attached
  *
  * @return \Illuminate\Cache\CacheManager
  */
 protected function cache()
 {
     if (!method_exists($this->cache, 'tags')) {
         return $this->cache;
     }
     return $this->cache->tags($this->tag);
 }
開發者ID:pavankumarkatakam,項目名稱:jwt-auth,代碼行數:12,代碼來源:IlluminateCacheAdapter.php

示例5: finish

 /**
  * Finish installation.
  *
  * @param Dispatcher   $events
  * @param CacheManager $cache
  * @return \Illuminate\View\View
  */
 public function finish(Dispatcher $events, CacheManager $cache)
 {
     $cache->store()->flush();
     $action = 'finish';
     $installers = $this->dispatch(new GetSeeders());
     $events->fire(new StreamsHasInstalled($installers));
     return view('anomaly.module.installer::process', compact('action', 'installers'));
 }
開發者ID:AkibaTech,項目名稱:installer-module,代碼行數:15,代碼來源:InstallerController.php

示例6: getStore

 public static function getStore()
 {
     if (!static::$store) {
         $manager = new CacheManager(new ConfigContainer(array('db' => \DLModel::getConnectionResolver(), 'encrypter' => Encrypter::getInstance(), 'config' => array('cache.driver' => 'database', 'cache.prefix' => 'schema_', 'cache.stores.database' => array('driver' => 'database', 'connection' => 'default', 'table' => 'cache')))));
         static::$store = $manager->driver('database')->getStore();
     }
     return static::$store;
 }
開發者ID:CFLOVEYR,項目名稱:hook,代碼行數:8,代碼來源:Cache.php

示例7: make

 public static function make()
 {
     if (is_null(self::$instance)) {
         $cacheManager = new CacheManager(array('files' => new FileSystem(), 'config' => array('cache.driver' => 'file', 'cache.path' => path('cache'), 'cache.prefix' => 'wordpress_')));
         $cache = $cacheManager->driver();
         self::$instance = new static($cache);
     }
     return self::$instance;
 }
開發者ID:bruno-barros,項目名稱:wordpress-packages,代碼行數:9,代碼來源:Cache.php

示例8: put

 public function put($request, $file)
 {
     if ($file) {
         $this->cache->put($this->makeCacheKey($request), $file, Carbon::now()->addMinutes(env('CACHE_EXPIRE_MINUTES')));
     }
     return $this;
 }
開發者ID:antonioribeiro,項目名稱:lumen-image-processor,代碼行數:7,代碼來源:Cache.php

示例9: has

 /**
  * Has
  * @param $key
  * @return bool
  */
 public function has($key)
 {
     if ($this->cacheDriver == "file") {
         return $this->cache->has($key);
     }
     return $this->cache->tags($this->tag)->has($key);
 }
開發者ID:MehmetNuri,項目名稱:fullycms,代碼行數:12,代碼來源:FullyCache.php

示例10: generate

 /**
  * Render weather widget.
  *
  * @param  array  $options
  * @return string
  */
 public function generate($options = array())
 {
     // Get options
     $options = array_merge($this->config['defaults'], $options);
     // Unify units
     $options['units'] = strtolower($options['units']);
     if (!in_array($options['units'], array('metric', 'imperial'))) {
         $options['units'] = 'imperial';
     }
     // Create cache key
     $cacheKey = 'Weather.' . md5(implode($options));
     // Check cache
     if ($this->config['cache'] && $this->cache->has($cacheKey)) {
         return $this->cache->get($cacheKey);
     }
     // Get current weather
     $current = $this->getWeather($options['query'], 0, $options['units'], 1);
     if ($current['cod'] !== 200) {
         return 'Unable to load weather';
     }
     // Get forecast
     $forecast = $this->getWeather($options['query'], $options['days'], $options['units']);
     // Render view
     $html = $this->view->make("{$this->config['views']}.{$options['style']}", array('current' => $current, 'forecast' => $forecast, 'units' => $options['units'], 'date' => $options['date']))->render();
     // Add to cache
     if ($this->config['cache']) {
         $this->cache->put($cacheKey, $html, $this->config['cache']);
     }
     return $html;
 }
開發者ID:torann,項目名稱:laravel-weather,代碼行數:36,代碼來源:Weather.php

示例11: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->laravel['events']->fire('cache:clearing');
     $this->cache->flush();
     $this->laravel['events']->fire('cache:cleared');
     $this->info('Application cache cleared!');
 }
開發者ID:fparralejo,項目名稱:btrabajo,代碼行數:12,代碼來源:ClearCommand.php

示例12: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->cache->flush();
     $this->files->delete($this->laravel['config']['app.manifest'] . '/services.json');
     $this->laravel['events']->fire('cache:cleared');
     $this->info('Application cache cleared!');
 }
開發者ID:arifmahmudrana,項目名稱:angularjs-laravel-boilerplate,代碼行數:12,代碼來源:ClearCommand.php

示例13: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $storeName = $this->argument('store');
     $this->laravel['events']->fire('cache:clearing', [$storeName]);
     $this->cache->store($storeName)->flush();
     $this->laravel['events']->fire('cache:cleared', [$storeName]);
     $this->info('Application cache cleared!');
 }
開發者ID:Ceciceciceci,項目名稱:MySJSU-Class-Registration,代碼行數:13,代碼來源:ClearCommand.php

示例14: handle

 public function handle()
 {
     $storeName = $this->config->get('laravel-responsecache.cacheStore');
     $this->laravel['events']->fire('responsecache:clearing', [$storeName]);
     $this->cache->store($storeName)->flush();
     $this->laravel['events']->fire('responsecache:cleared', [$storeName]);
     $this->info('Response cache cleared!');
 }
開發者ID:mcarriere,項目名稱:laravel-responsecache,代碼行數:8,代碼來源:ClearCommand.php

示例15: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     if (null !== ($key = $this->argument('key'))) {
         $this->keys = [$key];
     }
     foreach ($this->keys as $key) {
         $this->cacheManager->store()->forget($key);
     }
     $this->cacheManager->store()->tags(['dbQueryCache'])->flush();
     $this->info('Clear cache successfully!');
 }
開發者ID:BePsvPT,項目名稱:CCU,代碼行數:16,代碼來源:ClearCache.php


注:本文中的Illuminate\Cache\CacheManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。