当前位置: 首页>>代码示例>>PHP>>正文


PHP CacheManager::store方法代码示例

本文整理汇总了PHP中Illuminate\Cache\CacheManager::store方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::store方法的具体用法?PHP CacheManager::store怎么用?PHP CacheManager::store使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Cache\CacheManager的用法示例。


在下文中一共展示了CacheManager::store方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: handle

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     $tags = array_filter(explode(',', $this->option('tags')));
     $cache = $this->cache->store($store = $this->argument('store'));
     $this->laravel['events']->fire('cache:clearing', [$store, $tags]);
     if (!empty($tags)) {
         $cache->tags($tags)->flush();
     } else {
         $cache->flush();
     }
     $this->info('Cache cleared successfully.');
     $this->laravel['events']->fire('cache:cleared', [$store, $tags]);
 }
开发者ID:davidhemphill,项目名称:framework,代码行数:18,代码来源:ClearCommand.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: store

 /**
  * Get a cache store instance by name.
  *
  * @param string|null $name
  * @return mixed 
  * @static 
  */
 public static function store($name = null)
 {
     return \Illuminate\Cache\CacheManager::store($name);
 }
开发者ID:satriashp,项目名称:tour,代码行数:11,代码来源:_ide_helper.php

示例7: handle

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     $this->cache->store($this->argument('store'))->forget($this->argument('key'));
     $this->info('The [' . $this->argument('key') . '] key has been removed from the cache.');
 }
开发者ID:bryanashley,项目名称:framework,代码行数:10,代码来源:ForgetCommand.php

示例8: getCache

 /**
  * @return mixed|null
  */
 public static function getCache()
 {
     $Factory = self::getInstance();
     if (!$Factory->Cache) {
         if ($Factory->App) {
             # Use Laravel cache:
             $Factory->Cache = $Factory->App['cache'];
         } else {
             # Create cache manager:
             if ($cache = $Factory->config['cache']) {
                 switch ($cache['default']) {
                     case 'redis':
                         $Factory->Container['redis'] = new Database($Factory->config['database']['redis']);
                         break;
                     case 'memcached':
                         $Factory->Container['memcached.connector'] = new MemcachedConnector();
                         break;
                 }
                 $CacheManager = new CacheManager($Factory->Container);
                 $Factory->Cache = $CacheManager->store();
             }
         }
     }
     return $Factory->Cache;
 }
开发者ID:mightydes,项目名称:enjoin,代码行数:28,代码来源:Factory.php

示例9: function

use Illuminate\Container\Container;
use Illuminate\Filesystem\Filesystem;
require_once 'vendor/autoload.php';
/**
 * Illuminate/config
 *
 * @source https://github.com/illuminate/config
 */
$app = new \Slim\Slim();
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware());
$app->get('/', function () {
    // Create a new Container object, needed by the cache manager.
    $container = new Container();
    // The CacheManager creates the cache "repository" based on config values
    // which are loaded from the config class in the container.
    // More about the config class can be found in the config component; for now we will use an array
    $container['config'] = ['cache.default' => 'file', 'cache.stores.file' => ['driver' => 'file', 'path' => __DIR__ . '/cache']];
    // To use the file cache driver we need an instance of Illuminate's Filesystem, also stored in the container
    $container['files'] = new Filesystem();
    // Create the CacheManager
    $cacheManager = new CacheManager($container);
    // Get the default cache driver (file in this case)
    $cache = $cacheManager->store();
    // Or, if you have multiple drivers:
    // $cache = $cacheManager->store('file');
    // Store a value into cache for 500 minutes
    $cache->put('test', 'This is loaded from cache.', 500);
    // Echo out the value we just stored in cache
    echo $cache->get('test');
});
$app->run();
开发者ID:aaemnnosttv,项目名称:Torch,代码行数:31,代码来源:index.php

示例10: __construct

 /**
  * Create a new RollbackHandler instance.
  *
  * @param CacheManager $cache
  */
 public function __construct(CacheManager $cache)
 {
     $this->cache = $cache->store();
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:9,代码来源:RollbackHandler.php


注:本文中的Illuminate\Cache\CacheManager::store方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。