コード例 #1
1
 /**
  * Constructs this Shell instance.
  *
  * @param \Cake\Console\ConsoleIo $io An io instance.
  */
 public function __construct(ConsoleIo $io = null)
 {
     Cache::disable();
     parent::__construct($io);
 }
コード例 #2
0
 /**
  * testCacheDisabled method
  *
  * @return void
  */
 public function testCacheDisabled()
 {
     Cache::disable();
     $result = $this->_testEnabled();
     $this->assertEquals(false, $result);
     Cache::enable();
 }
コード例 #3
0
 /**
  * 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
0
 /**
  * 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
0
 /**
  * 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
0
 /**
  * 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
0
ファイル: BakeShell.php プロジェクト: maitrepylos/nazeweb
 /**
  * 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
0
 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
0
ファイル: SbShell.php プロジェクト: el-cms/Sb
 /**
  * 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
0
ファイル: AppController.php プロジェクト: ThreeCMS/ThreeCMS
 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
0
 /**
  * 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
0
ファイル: DumpTask.php プロジェクト: phpie/assetic-plugin
 /**
  * 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
0
ファイル: BakeTask.php プロジェクト: rashmi/newrepo
 /**
  * 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
0
 /**
  * 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
0
<?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]);
コード例 #16
0
ファイル: CacheTest.php プロジェクト: maitrepylos/nazeweb
 /**
  * Test toggling enabled state of cache.
  *
  * @return void
  */
 public function testEnableDisableEnabled()
 {
     $this->assertNull(Cache::enable());
     $this->assertTrue(Cache::enabled(), 'Should be on');
     $this->assertNull(Cache::disable());
     $this->assertFalse(Cache::enabled(), 'Should be off');
 }
コード例 #17
0
 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Cache::disable();
     App::objects('Plugin', null, true);
 }
コード例 #18
0
ファイル: ConfigureTest.php プロジェクト: rashmi/newrepo
 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Cache::disable();
 }
コード例 #19
0
ファイル: bootstrap.php プロジェクト: sebbdk/botcraft
 * Inflector::rules('uninflected', ['dontinflectme']);
 * Inflector::rules('transliteration', ['/å/' => 'aa']);
 */
/**
 * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
 * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
 * advanced ways of loading plugins
 *
 * Plugin::loadAll(); // Loads all plugins at once
 * Plugin::load('Migrations'); //Loads a single plugin named Migrations
 *
 */
Plugin::loadAll();
// Only try to load DebugKit in development mode
// Debug Kit should not be installed on a production system
if (Configure::read('debug')) {
    Plugin::load('DebugKit', ['bootstrap' => true]);
}
/**
 * Connect middleware/dispatcher filters.
 */
DispatcherFactory::add('Asset');
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
/**
 * Enable default locale format parsing.
 * This is needed for matching the auto-localized string output of Time() class when parsing dates.
 */
Type::build('datetime')->useLocaleParser();
Cache::disable();
コード例 #20
0
 /**
  * test cache()
  *
  * @return void
  */
 public function testCache()
 {
     Cache::disable();
     $result = cache('basics_test', 'simple cache write');
     $this->assertNull($result);
     $result = cache('basics_test');
     $this->assertNull($result);
     Cache::enable();
     $result = cache('basics_test', 'simple cache write');
     $this->assertTrue((bool) $result);
     $this->assertTrue(file_exists(CACHE . 'basics_test'));
     $result = cache('basics_test');
     $this->assertEquals('simple cache write', $result);
     if (file_exists(CACHE . 'basics_test')) {
         unlink(CACHE . 'basics_test');
     }
     cache('basics_test', 'expired', '+1 second');
     sleep(2);
     $result = cache('basics_test', null, '+1 second');
     $this->assertNull($result);
 }