当前位置: 首页>>代码示例>>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;未经允许,请勿转载。