当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::save方法代码示例

本文整理汇总了PHP中Settings::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::save方法的具体用法?PHP Settings::save怎么用?PHP Settings::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings的用法示例。


在下文中一共展示了Settings::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setSetting

 public static function setSetting($key, $value, $save)
 {
     self::$_settings->setSetting($key, $value);
     if ($save) {
         self::$_settings->save();
     }
 }
开发者ID:DoveID,项目名称:Magento2-Deployer,代码行数:7,代码来源:System.php

示例2: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $setting = new Settings();
     $setting->key = "tickets";
     $setting->value = json_encode(['should_send_email_ticket_reply' => true, 'convert_chat_ticket_no_operators' => true]);
     $setting->save();
 }
开发者ID:noikiy,项目名称:Xenon-Support-Center,代码行数:12,代码来源:2014_12_20_162546_fill_ticket_settings.php

示例3: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $setting = new Settings();
     $setting->key = "mailchimp";
     $setting->value = json_encode(['api_key' => "", 'use_mailchimp' => ""]);
     $setting->save();
 }
开发者ID:noikiy,项目名称:Xenon-Support-Center,代码行数:12,代码来源:2014_12_19_103328_fill_settings_mailchimp.php

示例4: updateAction

 public function updateAction()
 {
     Settings::load();
     $languages = Config::get()->languages->list;
     $start_pages = array();
     foreach ($languages as $language_id => $language) {
         $start_page = 0;
         if (isset($_POST['start-page-' . $language_id])) {
             $start_page = $this->sanitizeInteger($_POST['start-page-' . $language_id]);
         }
         $start_pages[$language_id] = $start_page;
     }
     Settings::set('startPages', $start_pages);
     $error_pages = array();
     foreach ($languages as $language_id => $language) {
         $error_page = 0;
         if (isset($_POST['error-page-' . $language_id])) {
             $error_page = $this->sanitizeInteger($_POST['error-page-' . $language_id]);
         }
         $error_pages[$language_id] = $error_page;
     }
     Settings::set('errorPages', $error_pages);
     $use_cache = $this->sanitizeBoolean(Request::postParam('use-cache', false));
     Settings::set('useCache', $use_cache);
     $cache_lifetime = $this->sanitizeInteger(Request::postParam('cache-lifetime', 0));
     Settings::set('cacheLifetime', $cache_lifetime);
     Settings::save();
     $this->success();
 }
开发者ID:pixelproduction,项目名称:PixelManagerCMS,代码行数:29,代码来源:Settings.php

示例5: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $setting = new Settings();
     $setting->key = "chat";
     $setting->value = json_encode(['chat_file_types' => 'jpeg,bmp,png,jpg', 'max_file_size' => '5', 'enable_attachment_in_chat' => true]);
     $setting->save();
 }
开发者ID:noikiy,项目名称:Xenon-Support-Center,代码行数:12,代码来源:2015_01_20_202847_add_chat_settings.php

示例6: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $setting = new Settings();
     $setting->key = "mail";
     $setting->value = json_encode(['api_key' => "", 'domain' => "", 'email' => "", 'name' => ""]);
     $setting->save();
 }
开发者ID:noikiy,项目名称:Xenon-Support-Center,代码行数:12,代码来源:2014_12_18_190745_add_mail_rows.php

示例7: execute

 function execute()
 {
     $data = $_POST;
     Settings::load('connection');
     foreach ($data as $key => $value) {
         Settings::set($key, $value, 'connection', false);
     }
     Settings::save('connection');
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:9,代码来源:connectionSettingsSave.action.php

示例8: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Settings();
     if (isset($_POST['Settings'])) {
         $model->attributes = $_POST['Settings'];
         if ($model->save()) {
             $this->redirect(array('admin'));
         }
     }
     $this->render('_form', array('model' => $model));
 }
开发者ID:blrtromax,项目名称:seobility,代码行数:15,代码来源:SettingsController.php

示例9: load

 public function load($templateName, $generalSettingsInstance = false)
 {
     //set default template as messy
     if (!$templateName) {
         foreach ($this->getAllTemplates() as $tpl) {
             list($template_all) = explode('-', $tpl);
             if ($template_all == 'messy') {
                 $templateName = $tpl;
                 break;
             } else {
                 $templateName = 'default';
             }
         }
         //save in settings
         $settings = new Settings(false);
         $settings->update('template', 'template', array('value' => $templateName));
         $settings->save();
     }
     $this->name = $templateName;
     $tPath = self::$options['TEMPLATES_FULL_SERVER_PATH'] . $this->name;
     if (!file_exists($tPath)) {
         $template = explode('-', $this->name);
         $template = $template[0];
         //try to get same template with different version if not exists
         foreach ($this->getAllTemplates() as $tpl) {
             list($template_all) = explode('-', $tpl);
             if ($template_all == $template) {
                 $this->name = $tpl;
                 break;
                 //default template = messy
             } else {
                 $this->name = 'default';
             }
         }
         $tPath = self::$options['TEMPLATES_FULL_SERVER_PATH'] . $this->name;
     }
     if (file_exists($tPath) && file_exists($tPath . '/template.conf.php')) {
         $this->smarty->template_dir = $tPath;
         $this->smarty->plugins_dir = array('plugins', self::$options['TEMPLATES_FULL_SERVER_PATH'] . '_plugins', $tPath . '/plugins');
         list($this->sectionTypes, $this->settingsDefinition) = (include $tPath . '/template.conf.php');
         $this->templateHTML = @file_get_contents($tPath . '/template.tpl');
         $this->templateFile = $tPath . '/template.tpl';
         $this->settings = new Settings($this->settingsDefinition, $generalSettingsInstance, $this->name);
         // instantiate settings for each section type definition (extend $this->settings)
         reset($this->sectionTypes);
         while (list($tName, $t) = each($this->sectionTypes)) {
             $this->sectionTypes[$tName]['settings'] = new Settings(false, $this->settings, false, isset($t['settings']) ? $t['settings'] : false);
         }
         return true;
     }
     return false;
 }
开发者ID:DhariniJeeva,项目名称:berta,代码行数:52,代码来源:class.bertatemplate.php

示例10: newSetting

 public function newSetting($key, $value, $type, $group)
 {
     $kv = self::getByKeyGroup($key, $group);
     if (null !== $kv) {
         throw new Exception('Key \'' . $key . '\' already exists.');
     }
     $nKv = new Settings();
     $nKv->setKey($key);
     $nKv->setValue($value);
     $nKv->setType($type);
     $nKv->setGroup($group);
     $nKv->save();
 }
开发者ID:hglattergotz,项目名称:uSettingsDoctrinePlugin,代码行数:13,代码来源:PluginSettingsTable.class.php

示例11: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Settings();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Settings'])) {
         $model->attributes = $_POST['Settings'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:branJakJak,项目名称:dienSiSystem,代码行数:17,代码来源:SettingsController.php

示例12: save

 public function save()
 {
     $settings = Settings::whereRaw("section='laramce' AND setting_name='plugins'")->first();
     if (!$settings->id) {
         $settings = new Settings();
     }
     $settings->area = 'backend';
     $settings->section = 'laramce';
     $settings->setting_name = 'plugins';
     $settings->setting_value = implode(" ", Input::get('plugins'));
     $settings->autoload = 1;
     $settings->save();
     return Redirect::to('backend/laramce')->withMessage($this->notifyView(Lang::get('messages.settings_saved'), 'success'));
 }
开发者ID:basdog22,项目名称:laracms,代码行数:14,代码来源:LaramceController.php

示例13: get_or_create

 public static function get_or_create($name, $category, $siteId = false)
 {
     if (!$siteId) {
         $siteId = SITE_ID;
     }
     $setting = Doctrine_Query::create()->from('Settings s')->where('s.site_id = ? AND s.name = ? AND s.category = ?', array($siteId, $name, $category))->fetchOne();
     if (!$setting) {
         $setting = new Settings();
         $setting->name = $name;
         $setting->category = $category;
         $setting->site_id = $siteId;
         $setting->save();
     }
     return $setting;
 }
开发者ID:hbasria,项目名称:pjango,代码行数:15,代码来源:Settings.php

示例14: savesettings

 public function savesettings()
 {
     if (Input::get('id')) {
         $settings = Settings::find(Input::get('id'));
     } else {
         $settings = new Settings();
     }
     $settings->area = Input::get('area');
     $settings->section = Input::get('section');
     $settings->setting_name = Input::get('setting_name');
     $settings->setting_value = Input::get('setting_value');
     $settings->autoload = Input::get('autoload');
     Event::fire('backend.settings.save', array($settings));
     $settings->save();
     return Redirect::to('backend/settings/')->withMessage($this->notifyView(Lang::get('laracms::messages.settings_saved'), 'success'));
 }
开发者ID:basdog22,项目名称:laracms,代码行数:16,代码来源:LaraBackendController.php

示例15: init

 public function init()
 {
     $http = new http();
     //$http->setProxy('localhost', 666);
     //$http->setTimeout(10);
     if (!is_writeable(TMP)) {
         Yii::app()->user->setFlash('notify', array('type' => 'danger', 'message' => Yii::t('admin', 'Error make TMP writeable: ' . TMP)));
         return false;
     }
     $repo = Settings::model()->getValue('repo');
     if ($repo && !empty($repo)) {
         $this->driver = new dropWebLight($repo, $http);
         return true;
     } elseif ($repo === false) {
         $model = new Settings();
         $model->option = 'repo';
         $model->value = '';
         $model->save();
     }
 }
开发者ID:mrtos,项目名称:OpenNVR,代码行数:20,代码来源:driversManager.php


注:本文中的Settings::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。