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


PHP Db::setSetting方法代碼示例

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


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

示例1: _set

 /**
  * set the setting
  *
  * @since 3.0.0
  *
  * @param array $optionArray
  *
  * @return boolean
  */
 protected function _set($optionArray = [])
 {
     $key = $this->prompt('key', $optionArray);
     $value = $this->prompt('value', $optionArray);
     if ($key && $value) {
         return Db::setSetting($key, $value);
     }
     return false;
 }
開發者ID:redaxmedia,項目名稱:redaxscript,代碼行數:18,代碼來源:Setting.php

示例2: tearDownAfterClass

 /**
  * tearDownAfterClass
  *
  * @since 3.0.0
  */
 public static function tearDownAfterClass()
 {
     Db::setSetting('captcha', 0);
     Db::setSetting('notification', 0);
 }
開發者ID:redaxmedia,項目名稱:redaxscript,代碼行數:10,代碼來源:RegisterTest.php

示例3: testMailFailure

 /**
  * testMailFailure
  *
  * @since 3.0.0
  *
  * @param array $postArray
  * @param array $hashArray
  * @param array $settingArray
  * @param string $expect
  *
  * @dataProvider providerMailFailure
  */
 public function testMailFailure($postArray = [], $hashArray = [], $settingArray = [], $expect = null)
 {
     /* setup */
     Db::setSetting('notification', $settingArray['notification']);
     Db::setSetting('moderation', $settingArray['moderation']);
     $this->_request->set('post', $postArray);
     $this->_request->setPost('solution', function_exists('password_verify') ? $hashArray[0] : $hashArray[1]);
     $stub = $this->getMockBuilder('Redaxscript\\Controller\\Comment')->setConstructorArgs([$this->_registry, $this->_language, $this->_request])->setMethods(['_mail'])->getMock();
     /* override */
     $stub->expects($this->any())->method('_mail')->will($this->returnValue(false));
     /* actual */
     $actual = $stub->process();
     /* compare */
     $this->assertEquals($expect, $actual);
 }
開發者ID:redaxmedia,項目名稱:redaxscript,代碼行數:27,代碼來源:CommentTest.php

示例4: tearDownAfterClass

 /**
  * tearDownAfterClass
  *
  * @since 3.0.0
  */
 public static function tearDownAfterClass()
 {
     Db::setSetting('captcha', 0);
     Db::forTablePrefix('users')->whereIdIs(1)->findOne()->set('password', 'test')->save();
 }
開發者ID:redaxmedia,項目名稱:redaxscript,代碼行數:10,代碼來源:LoginTest.php

示例5: testGetAndSetSetting

 /**
  * testGetAndSetSetting
  *
  * @since 2.2.0
  */
 public function testGetAndSetSetting()
 {
     /* setup */
     Db::setSetting('charset', 'utf-8');
     /* actual */
     $actual = Db::getSetting('charset');
     /* compare */
     $this->assertEquals('utf-8', $actual);
 }
開發者ID:redaxmedia,項目名稱:redaxscript,代碼行數:14,代碼來源:DbTest.php

示例6: testProcess

 /**
  * testProcess
  *
  * @since 3.0.0
  *
  * @param array $postArray
  * @param array $hashArray
  * @param array $settingArray
  * @param string $expect
  *
  * @dataProvider providerProcess
  */
 public function testProcess($postArray = [], $hashArray = [], $settingArray = [], $expect = null)
 {
     /* setup */
     Db::setSetting('notification', $settingArray['notification']);
     Db::setSetting('moderation', $settingArray['moderation']);
     $this->_request->set('post', $postArray);
     $this->_request->setPost('solution', function_exists('password_verify') ? $hashArray[0] : $hashArray[1]);
     $commentController = new Controller\Comment($this->_registry, $this->_language, $this->_request);
     /* actual */
     $actual = $commentController->process();
     /* compare */
     $this->assertEquals($expect, $actual);
 }
開發者ID:redaxmedia,項目名稱:redaxscript,代碼行數:25,代碼來源:CommentTest.php


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