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


PHP Cache::enable方法代码示例

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


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

示例1: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->skipIf(!class_exists('Redis'), 'Redis is not installed or configured properly.');
     Cache::enable();
     $this->_configCache();
 }
开发者ID:neilan35,项目名称:betterwindow1,代码行数:12,代码来源:RedisEngineTest.php

示例2: setUp

 /**
  * Setup function
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->connection = ConnectionManager::get('test');
     Cache::clear(false, '_cake_method_');
     Cache::enable();
 }
开发者ID:cakedc,项目名称:cakephp-oracle-driver,代码行数:12,代码来源:CollectionTest.php

示例3: testCacheDisabled

 /**
  * testCacheDisabled method
  *
  * @return void
  */
 public function testCacheDisabled()
 {
     Cache::disable();
     $result = $this->_testEnabled();
     $this->assertEquals(false, $result);
     Cache::enable();
 }
开发者ID:chnvcode,项目名称:cakephp-viewmemcached,代码行数:12,代码来源:ViewMemcachedHelperTest.php

示例4: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Cache::enable();
     $this->_configCache();
     Cache::clear(false, 'file_test');
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:12,代码来源:FileEngineTest.php

示例5: setupBeforeClass

 /**
  * test case startup
  *
  * @return void
  */
 public static function setupBeforeClass()
 {
     Cache::enable();
     Cache::config('session_test', ['engine' => 'File', 'path' => TMP . 'sessions', 'prefix' => 'session_test']);
     static::$_sessionBackup = Configure::read('Session');
     Configure::write('Session.handler.config', 'session_test');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:CacheSessionTest.php

示例6: setUp

 /**
  * Setup method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->engine = $this->getMock('Cake\\Cache\\CacheEngine');
     $this->engine->expects($this->any())->method('init')->will($this->returnValue(true));
     Cache::config('queryCache', $this->engine);
     Cache::enable();
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:13,代码来源:QueryCacherTest.php

示例7: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->skipIf(!function_exists('wincache_ucache_set'), 'Wincache is not installed or configured properly.');
     $this->skipIf(!ini_get('wincache.enablecli'), 'Wincache is not enabled on the CLI.');
     Cache::enable();
     $this->_configCache();
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:13,代码来源:WincacheEngineTest.php

示例8: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     $this->assertFalse(defined('HHVM_VERSION'), 'Crashes HHVM');
     parent::setUp();
     $this->skipIf(!class_exists('Redis'), 'Redis is not installed or configured properly.');
     Cache::enable();
     $this->_configCache();
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:13,代码来源:RedisEngineTest.php

示例9: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     if (!function_exists('xcache_set')) {
         $this->markTestSkipped('Xcache is not installed or configured properly');
     }
     Cache::enable();
     Cache::config('xcache', ['engine' => 'Xcache', 'prefix' => 'cake_']);
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:14,代码来源:XcacheEngineTest.php

示例10: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->skipIf(!function_exists('apc_store'), 'Apc is not installed or configured properly.');
     if (php_sapi_name() === 'cli') {
         $this->skipIf(!ini_get('apc.enable_cli'), 'APC is not enabled for the CLI.');
     }
     Cache::enable();
     $this->_configCache();
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:15,代码来源:ApcEngineTest.php

示例11: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->skipIf(!function_exists('apcu_store'), 'APCu is not installed or configured properly.');
     if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
         $this->skipIf(!ini_get('apc.enable_cli'), 'APC is not enabled for the CLI.');
     }
     Cache::enable();
     $this->_configCache();
 }
开发者ID:jdaosavanh,项目名称:clickerwebapp,代码行数:15,代码来源:ApcEngineTest.php

示例12: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->skipIf(!class_exists('Redis'), 'Redis extension is not installed or configured properly.');
     // @codingStandardsIgnoreStart
     $socket = @fsockopen('127.0.0.1', 6379, $errno, $errstr, 1);
     // @codingStandardsIgnoreEnd
     $this->skipIf(!$socket, 'Redis is not running.');
     fclose($socket);
     Cache::enable();
     $this->_configCache();
 }
开发者ID:JesseDarellMoore,项目名称:CS499,代码行数:17,代码来源:RedisEngineTest.php

示例13: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
         $this->markTestSkipped('Xcache is not available for the CLI.');
     }
     if (!function_exists('xcache_set')) {
         $this->markTestSkipped('Xcache is not installed or configured properly');
     }
     Cache::enable();
     Cache::config('xcache', ['engine' => 'Xcache', 'prefix' => 'cake_']);
 }
开发者ID:JesseDarellMoore,项目名称:CS499,代码行数:17,代码来源:XcacheEngineTest.php

示例14: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Connection = ConnectionManager::get('test');
     $this->Collection = new Collection($this->Connection);
     $this->View = new View();
     $this->Helper = new MigrationHelper($this->View, ['collection' => $this->Collection]);
     Cache::clear(false, '_cake_model_');
     Cache::enable();
     $this->loadFixtures('Users');
     $this->loadFixtures('SpecialTags');
     $this->values = ['null' => 'NULL', 'integerNull' => null, 'integerLimit' => null, 'comment' => null];
     if (getenv('DB') == 'mysql') {
         $this->values = ['null' => null, 'integerNull' => null, 'integerLimit' => 11, 'comment' => ''];
     }
     if (getenv('DB') == 'pgsql') {
         $this->values = ['null' => null, 'integerNull' => null, 'integerLimit' => 10, 'comment' => null];
     }
 }
开发者ID:ansidev,项目名称:cakephp_blog,代码行数:24,代码来源:MigrationHelperTest.php

示例15: testFullPageCachingDispatch

 /**
  * testFullPageCachingDispatch method
  *
  * @dataProvider cacheActionProvider
  * @return void
  */
 public function testFullPageCachingDispatch($url)
 {
     Cache::enable();
     Configure::write('Cache.disable', false);
     Configure::write('Cache.check', true);
     Configure::write('debug', true);
     Router::reload();
     Router::connect('/', array('controller' => 'test_cached_pages', 'action' => 'index'));
     Router::connect('/:controller/:action/*');
     $dispatcher = new TestDispatcher();
     $request = new Request($url);
     $response = $this->getMock('Cake\\Network\\Response', array('send'));
     $dispatcher->dispatch($request, $response);
     $out = $response->body();
     Configure::write('Dispatcher.filters', array('CacheDispatcher'));
     $request = new Request($url);
     $response = $this->getMock('Cake\\Network\\Response', array('send'));
     $dispatcher = new TestDispatcher();
     $dispatcher->dispatch($request, $response);
     $cached = $response->body();
     $cached = preg_replace('/<!--+[^<>]+-->/', '', $cached);
     $this->assertTextEquals($out, $cached);
     $filename = $this->_cachePath($request->here());
     unlink($filename);
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:31,代码来源:DispatcherTest.php


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