本文整理汇总了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();
}
示例2: setUp
/**
* Setup function
*
* @return void
*/
public function setUp()
{
parent::setUp();
$this->connection = ConnectionManager::get('test');
Cache::clear(false, '_cake_method_');
Cache::enable();
}
示例3: testCacheDisabled
/**
* testCacheDisabled method
*
* @return void
*/
public function testCacheDisabled()
{
Cache::disable();
$result = $this->_testEnabled();
$this->assertEquals(false, $result);
Cache::enable();
}
示例4: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Cache::enable();
$this->_configCache();
Cache::clear(false, 'file_test');
}
示例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');
}
示例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();
}
示例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();
}
示例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();
}
示例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_']);
}
示例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();
}
示例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();
}
示例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();
}
示例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_']);
}
示例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];
}
}
示例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);
}