當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。