本文整理汇总了PHP中Cake\Cache\Cache::disable方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache::disable方法的具体用法?PHP Cache::disable怎么用?PHP Cache::disable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Cache\Cache
的用法示例。
在下文中一共展示了Cache::disable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructs this Shell instance.
*
* @param \Cake\Console\ConsoleIo $io An io instance.
*/
public function __construct(ConsoleIo $io = null)
{
Cache::disable();
parent::__construct($io);
}
示例2: testCacheDisabled
/**
* testCacheDisabled method
*
* @return void
*/
public function testCacheDisabled()
{
Cache::disable();
$result = $this->_testEnabled();
$this->assertEquals(false, $result);
Cache::enable();
}
示例3: startup
/**
* Assign $this->connection to the active task if a connection param is set.
*
* @return void
*/
public function startup()
{
parent::startup();
Configure::write('debug', true);
Cache::disable();
if (isset($this->params['connection'])) {
$this->connection = $this->params['connection'];
}
}
示例4: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Cache::disable();
$this->request = $this->getMock('Cake\\Network\\Request');
$this->response = $this->getMock('Cake\\Network\\Response');
$this->Seobox = new SeoboxCell($this->request, $this->response);
$this->Seobox->viewBuilder()->className('View');
$this->Seobox->viewBuilder()->layout('default');
$this->View = $this->Seobox->createView();
}
示例5: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Cache::disable();
$request = new request();
$response = new response();
$this->Controller = new SeoComponentTestController(new Request('/articles/view?slug=test-title-one'));
$this->Controller->viewBuilder()->className('View');
$this->Controller->viewBuilder()->layout('default');
$this->Controller->startupProcess();
$this->View = $this->Controller->createView();
}
示例6: startup
/**
* Assign $this->connection to the active task if a connection param is set.
*
* @return void
*/
public function startup()
{
parent::startup();
Cache::disable();
$this->UserTable = TableRegistry::get($this->param('model'), ['connection' => ConnectionManager::get($this->param('connection'))]);
if (!$this->UserTable->hasBehavior('Burzum/UserTools.User')) {
$this->UserTable->addBehavior('Burzum/UserTools.User');
}
try {
$this->UserTable->schema();
} catch (\Exception $e) {
$this->err($e->getMessage());
$this->_stop(1);
}
}
示例7: startup
/**
* Assign $this->connection to the active task if a connection param is set.
*
* @return void
*/
public function startup()
{
parent::startup();
Configure::write('debug', true);
Cache::disable();
$task = $this->_camelize($this->command);
if (isset($this->{$task}) && !in_array($task, ['Project'])) {
if (isset($this->params['connection'])) {
$this->{$task}->connection = $this->params['connection'];
}
}
if (isset($this->params['connection'])) {
$this->connection = $this->params['connection'];
}
}
示例8: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
//データベース接続設定
$connectionInfo = self::$_connectionInfo;
//cacheの設定はしていないためcacheを無効にする
Cache::disable();
//defaultは使わないがいないとエラーになるのでテストと同じものを設定する
Configure::write('Datasources.default', $connectionInfo);
Configure::write('Datasources.test', $connectionInfo);
ConnectionManager::config(Configure::consume('Datasources'));
//APPが定義されていないとエラーになるため。(逆に何か設定してあればとりあえず動くみたい?)
if (!defined('APP')) {
define('APP', self::$_appInfo);
}
}
示例9: startup
/**
* Assign $this->connection to the active task if a connection param is set.
*
* @return void
*/
public function startup()
{
$this->Sbc = new Sbc();
$this->Sbc->loadConfig();
parent::startup();
Configure::write('debug', true);
Cache::disable();
$task = $this->_camelize($this->command);
if (isset($this->{$task})) {
if (isset($this->params['connection'])) {
$this->{$task}->connection = $this->params['connection'];
}
}
if (isset($this->params['connection'])) {
$this->connection = $this->params['connection'];
}
}
示例10: initialize
public function initialize()
{
parent::initialize();
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
$this->loadComponent('Csrf');
$this->loadComponent('Security');
$this->loadComponent('Paginator');
$this->loadComponent('Cookie');
$this->loadComponent('Auth', ['authenticate' => ['Form' => ['fields' => ['username' => 'email']], 'Cookie']]);
SettingsData::initialize();
SettingsData::getAll();
$this->Cookie->configKey('CookieAuth', ['expires' => Configure::read('security.cookieAuthDuration'), 'httpOnly' => true]);
if (SettingsData::get('debug') == true) {
Cache::disable();
}
EventDispatcher::dispatch('Settings.init', $this);
}
示例11: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
TableRegistry::clear();
Cache::disable();
Router::reload();
//Router::fullBaseUrl('http://test.local');
Router::scope('/', function ($routes) {
$routes->fallbacks('DashedRoute');
});
$this->Articles = TableRegistry::get('Articles', ['className' => 'Seo\\Test\\TestCase\\Model\\Behavior\\ArticlesTable']);
$this->Articles->addBehavior('Seo.Seo', $this->defaultConfig);
$this->SeoBehavior = new SeoBehavior($this->Articles, $this->defaultConfig);
$this->setReflectionClassInstance($this->SeoBehavior);
//$this->defaultReflectionTarget = $this->SeoBehavior; // (optional)
$this->defaultEntity = $this->Articles->find()->first();
$this->locale = I18n::locale();
}
示例12: startup
/**
* Starts up the Shell and displays the welcome message.
* Allows for checking and configuring prior to command or main execution
*
* Override this method if you want to remove the welcome information,
* or otherwise modify the pre-command flow.
*
* @return void
*/
public function startup()
{
Cache::disable();
}
示例13: startup
/**
* Disable caching and enable debug for baking.
* This forces the most current database schema to be used.
*
* @return void
*/
public function startup()
{
Configure::write('debug', true);
Cache::disable();
}
示例14: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
$_GET = [];
Configure::write('App.base', false);
Configure::write('App.baseUrl', false);
Configure::write('App.dir', 'app');
Configure::write('App.webroot', 'webroot');
Configure::write('App.namespace', 'TestApp');
Cache::disable();
App::objects('Plugin', null, false);
}
示例15: dirname
<?php
/**
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
// include autoload from Composer
use Cake\Core\Plugin;
require dirname(__DIR__) . '/vendor/autoload.php';
// include paths from CakePHP
require dirname(__DIR__) . '/tests/paths.php';
// disable cache to avoid errors on tests
\Cake\Cache\Cache::disable();
Plugin::load('TestPlugin', ['path' => ROOT . DS . 'Plugin' . DS . 'TestPlugin' . DS]);
Plugin::load('Namespaced/Plugin', ['path' => ROOT . DS . 'Plugin' . DS . 'Namespaced' . DS . 'Plugin' . DS]);
Plugin::load('Namespaced2/TestPlugin', ['path' => ROOT . DS . 'Plugin' . DS . 'Namespaced2' . DS . 'TestPlugin' . DS]);
Plugin::load('FooBar/TestPlugin', ['path' => ROOT . DS . 'Plugin' . DS . 'FooBar' . DS . 'TestPlugin' . DS]);