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


PHP DbConfig::setSetting方法代碼示例

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


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     /********** General Settings **********/
     if (!$this->str->equals($this->httpRequest->post('site_name'), DbConfig::getSetting('siteName'))) {
         DbConfig::setSetting($this->httpRequest->post('site_name'), 'siteName');
     }
     if (!$this->str->equals($this->httpRequest->post('default_template'), DbConfig::getSetting('defaultTemplate'))) {
         DbConfig::setSetting($this->httpRequest->post('default_template'), 'defaultTemplate');
     }
     if (!$this->str->equals($this->httpRequest->post('default_language'), DbConfig::getSetting('defaultLanguage'))) {
         DbConfig::setSetting($this->httpRequest->post('default_language'), 'defaultLanguage');
     }
     if (!$this->str->equals($this->httpRequest->post('map_type'), DbConfig::getSetting('mapType'))) {
         DbConfig::setSetting($this->httpRequest->post('map_type'), 'mapType');
     }
     if (!$this->str->equals($this->httpRequest->post('splash_page'), DbConfig::getSetting('splashPage'))) {
         DbConfig::setSetting($this->httpRequest->post('splash_page'), 'splashPage');
     }
     if (!$this->str->equals($this->httpRequest->post('bg_splash_vid'), DbConfig::getSetting('bgSplashVideo'))) {
         DbConfig::setSetting($this->httpRequest->post('bg_splash_vid'), 'bgSplashVideo');
     }
     if (!$this->str->equals($this->httpRequest->post('full_ajax_site'), DbConfig::getSetting('fullAjaxSite'))) {
         DbConfig::setSetting($this->httpRequest->post('full_ajax_site'), 'fullAjaxSite');
     }
     if (!$this->str->equals($this->httpRequest->post('site_status'), DbConfig::getSetting('siteStatus'))) {
         DbConfig::setSiteMode($this->httpRequest->post('site_status'));
     }
     if (!$this->str->equals($this->httpRequest->post('disclaimer'), DbConfig::getSetting('disclaimer'))) {
         DbConfig::setSetting($this->httpRequest->post('disclaimer'), 'disclaimer');
     }
     if (!$this->str->equals($this->httpRequest->post('cookie_consent_bar'), DbConfig::getSetting('cookieConsentBar'))) {
         DbConfig::setSetting($this->httpRequest->post('cookie_consent_bar'), 'cookieConsentBar');
     }
     if (!$this->str->equals($this->httpRequest->post('is_software_news_feed'), DbConfig::getSetting('isSoftwareNewsFeed'))) {
         DbConfig::setSetting($this->httpRequest->post('is_software_news_feed'), 'isSoftwareNewsFeed');
     }
     /********** Logo Settings **********/
     if (!empty($_FILES['logo']['tmp_name'])) {
         $oLogo = new Framework\Image\Image($_FILES['logo']['tmp_name']);
         if (!$oLogo->validate()) {
             \PFBC\Form::setError('form_setting', Form::wrongImgFileTypeMsg());
             $this->bIsErr = true;
         } else {
             /*
              * The method deleteFile first test if the file exists, if so it delete the file.
              */
             $sPathName = PH7_PATH_TPL . PH7_TPL_NAME . PH7_DS . PH7_IMG . 'logo.png';
             $this->file->deleteFile($sPathName);
             // It erases the old logo.
             $oLogo->dynamicResize(250, 60);
             $oLogo->save($sPathName);
             // Clear CSS cache, because the logo is storaged with data URI in the CSS cache file
             $this->file->deleteDir(PH7_PATH_CACHE . Framework\Layout\Gzip::CACHE_DIR);
             // Clear the Web browser cache
             (new Framework\Navigation\Browser())->noCache();
         }
     }
     /********** Email **********/
     if (!$this->str->equals($this->httpRequest->post('email_name'), DbConfig::getSetting('emailName'))) {
         DbConfig::setSetting($this->httpRequest->post('email_name'), 'emailName');
     }
     if (!$this->str->equals($this->httpRequest->post('admin_email'), DbConfig::getSetting('adminEmail'))) {
         DbConfig::setSetting($this->httpRequest->post('admin_email'), 'adminEmail');
     }
     if (!$this->str->equals($this->httpRequest->post('feedback_email'), DbConfig::getSetting('feedbackEmail'))) {
         DbConfig::setSetting($this->httpRequest->post('feedback_email'), 'feedbackEmail');
     }
     if (!$this->str->equals($this->httpRequest->post('return_email'), DbConfig::getSetting('returnEmail'))) {
         DbConfig::setSetting($this->httpRequest->post('return_email'), 'returnEmail');
     }
     /********** Registration **********/
     if (!$this->str->equals($this->httpRequest->post('user_activation_type'), DbConfig::getSetting('userActivationType'))) {
         DbConfig::setSetting($this->httpRequest->post('user_activation_type'), 'userActivationType');
     }
     if (!$this->str->equals($this->httpRequest->post('aff_activation_type'), DbConfig::getSetting('affActivationType'))) {
         DbConfig::setSetting($this->httpRequest->post('aff_activation_type'), 'affActivationType');
     }
     if (!$this->str->equals($this->httpRequest->post('min_username_length'), DbConfig::getSetting('minUsernameLength'))) {
         $iMaxUsernameLength = DbConfig::getSetting('maxUsernameLength') - 1;
         if ($this->httpRequest->post('min_username_length') > $iMaxUsernameLength) {
             \PFBC\Form::setError('form_setting', t('The minimum length of the username cannot exceed %0% characters.', $iMaxUsernameLength));
             $this->bIsErr = true;
         } else {
             DbConfig::setSetting($this->httpRequest->post('min_username_length'), 'minUsernameLength');
         }
     }
     if (!$this->str->equals($this->httpRequest->post('max_username_length'), DbConfig::getSetting('maxUsernameLength'))) {
         if ($this->httpRequest->post('max_username_length') > PH7_MAX_USERNAME_LENGTH) {
             \PFBC\Form::setError('form_setting', t('The maximum length of the username cannot exceed %0% characters.', PH7_MAX_USERNAME_LENGTH));
             $this->bIsErr = true;
         } else {
             DbConfig::setSetting($this->httpRequest->post('max_username_length'), 'maxUsernameLength');
         }
     }
     if (!$this->str->equals($this->httpRequest->post('min_age_registration'), DbConfig::getSetting('minAgeRegistration'))) {
         if ($this->httpRequest->post('min_age_registration') >= DbConfig::getSetting('maxAgeRegistration')) {
             \PFBC\Form::setError('form_setting', t('You cannot specify a minimum age higher than the maximum age.'));
             $this->bIsErr = true;
         } else {
//.........這裏部分代碼省略.........
開發者ID:revcozmo,項目名稱:pH7-Social-Dating-CMS,代碼行數:101,代碼來源:SettingFormProcess.php

示例2: set

 /**
  * Set a site validated/unvalidated.
  *
  * @param integer $iStatus Set "1" to validate the site or "0" to unvalidated it. Default: 1
  * @return integer 1 on success.
  */
 public function set($iStatus = 1)
 {
     return DbConfig::setSetting($iStatus, 'isSiteValidated');
 }
開發者ID:huangciyin,項目名稱:pH7-Social-Dating-CMS,代碼行數:10,代碼來源:ValidateSiteModel.php


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