當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Configure::write方法代碼示例

本文整理匯總了PHP中Cake\Core\Configure::write方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configure::write方法的具體用法?PHP Configure::write怎麽用?PHP Configure::write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cake\Core\Configure的用法示例。


在下文中一共展示了Configure::write方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * Setup
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('App.namespace', 'TestApp');
     Configure::write('Security.salt', 'not-the-default');
     $this->object = $this->getObjectForTrait('Cake\\Routing\\RequestActionTrait');
 }
開發者ID:ripzappa0924,項目名稱:carte0.0.1,代碼行數:12,代碼來源:RequestActionTraitTest.php

示例2: setUp

 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('App.namespace', 'TestApp');
     $this->Comments = TableRegistry::get('BitmaskedComments');
     $this->Comments->addBehavior('Tools.Bitmasked', ['mappedField' => 'statuses']);
 }
開發者ID:dereuromark,項目名稱:cakephp-tools,代碼行數:10,代碼來源:BitmaskedBehaviorTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     Configure::write('App.namespace', 'TestApp');
     $this->Comments = TableRegistry::get('JsonableComments');
     $this->Comments->addBehavior('Tools.Jsonable', ['fields' => ['details']]);
 }
開發者ID:repher,項目名稱:cakephp-tools,代碼行數:7,代碼來源:JsonableBehaviorTest.php

示例4: testBake

 /**
  * Test generating code.
  *
  * @return void
  */
 public function testBake()
 {
     Configure::write('App.namespace', 'Bake\\Test\\App');
     $this->Task->expects($this->once())->method('createFile')->with($this->_normalizePath(APP . 'Model/Behavior/ExampleBehavior.php'), $this->stringContains('class ExampleBehavior extends Behavior'));
     $result = $this->Task->bake('Example');
     $this->assertSameAsFile(__FUNCTION__ . '.php', $result);
 }
開發者ID:rashmi,項目名稱:newrepo,代碼行數:12,代碼來源:SimpleBakeTaskTest.php

示例5: setUp

 /**
  * setUp
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('Acl.classname', 'DbAcl');
     Configure::write('Acl.database', 'test');
     $this->Task = $this->getMock('Acl\\AclExtras', ['in', 'out', 'hr', 'createFile', 'error', 'err', 'clear', 'getControllerList']);
 }
開發者ID:edukondaluetg,項目名稱:acl,代碼行數:12,代碼來源:AclExtrasTest.php

示例6: setUp

 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->event = new Event('Controller.beforeFilter');
     $this->Controller = new UrlComponentTestController(new Request());
     Configure::write('App.fullBaseUrl', 'http://localhost');
 }
開發者ID:dereuromark,項目名稱:cakephp-tools,代碼行數:10,代碼來源:UrlComponentTest.php

示例7: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('Acl.classname', __NAMESPACE__ . '\\CachedDbAclTwoTest');
     $this->CachedDb = new CachedDbAclTwoTest();
     Cache::config('tests', ['engine' => 'File', 'path' => TMP, 'prefix' => 'test_']);
 }
開發者ID:edukondaluetg,項目名稱:acl,代碼行數:12,代碼來源:CacheDbAclTest.php

示例8: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('debug', true);
     Log::drop('stderr');
     Log::drop('stdout');
 }
開發者ID:alexunique0519,項目名稱:Blog_Cakephp_association,代碼行數:12,代碼來源:DebuggerTest.php

示例9: setUp

 /**
  * setup test
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->io = $this->getMock('Cake\\Console\\ConsoleIo', [], [], '', false);
     $this->Shell = $this->getMock('Bake\\Shell\\BakeShell', ['in', 'out', 'hr', 'err', 'createFile', '_stop'], [$this->io]);
     Configure::write('App.namespace', 'Bake\\Test\\App');
 }
開發者ID:neilan35,項目名稱:betterwindow1,代碼行數:12,代碼來源:BakeShellTest.php

示例10: testIndexNotAuthorized

 /**
  * Test if the index request is authorized.
  *
  * @return void
  */
 public function testIndexNotAuthorized()
 {
     Configure::write('CA.Models.articles', 'Articles');
     $this->get('/admin/posttypes/articles/index');
     $this->assertResponseSuccess();
     $this->assertRedirect('/admin');
 }
開發者ID:cakemanager,項目名稱:cakephp-cakeadmin,代碼行數:12,代碼來源:SettingsControllerTest.php

示例11: mergeConfig

 /**
  * Merge Configuration
  *
  * @param string $key Configure key
  * @param array $config New configuration to merge
  * @param return array Array of merged configurations
  */
 public static function mergeConfig($key, $config)
 {
     $values = Configure::read($key);
     $values = Hash::merge((array) $values, $config);
     Configure::write($key, $values);
     return $values;
 }
開發者ID:mohammadsaleh,項目名稱:spider,代碼行數:14,代碼來源:Spider.php

示例12: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('App.namespace', 'TestApp');
     $this->View = new UIView();
     $this->View->layout = 'default';
 }
開發者ID:olafthelofty,項目名稱:carenta,代碼行數:12,代碼來源:UIViewTraitTest.php

示例13: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('Captcha', ['debug' => false]);
     $config = [];
     $this->Math = new MathEngine($config);
 }
開發者ID:dereuromark,項目名稱:cakephp-captcha,代碼行數:12,代碼來源:MathEngineTest.php

示例14: initialize

 public function initialize()
 {
     parent::initialize();
     /**
      * Define Content settings
      */
     Configure::write('Content', ['defaultUsersTable' => 'Users', 'defaultRolesTable' => 'Roles', 'defaultSiteId' => 1]);
     /**
      * Manage site selector
      */
     if ($this->request->is(['patch', 'post', 'put'])) {
         if (isset($this->request->data['current_site_id'])) {
             $this->request->session()->write('Content.currentSiteId', intval($this->request->data['current_site_id']));
         }
     }
     $this->CmsSites = TableRegistry::get('Content.CmsSites');
     $sites = $this->CmsSites->find('all')->toArray();
     $site_selector = [];
     foreach ($sites as $row) {
         $site_selector[$row->id] = $row->name;
         if (!$this->request->session()->check('Content.currentSiteId')) {
             $this->request->session()->write('Content.currentSiteId', $row->id);
         }
     }
     $this->set(compact('site_selector'));
 }
開發者ID:aoliverio,項目名稱:content,代碼行數:26,代碼來源:AppController.php

示例15: setUp

 public function setUp()
 {
     parent::setUp();
     Configure::write('debug', false);
     $this->Articles = TableRegistry::get('Articles');
     $this->Authors = TableRegistry::get('Authors');
 }
開發者ID:andrej-griniuk,項目名稱:cakephp-fractal-transformer-view,代碼行數:7,代碼來源:FractalTransformerViewTest.php


注:本文中的Cake\Core\Configure::write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。