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


PHP Config::save方法代码示例

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


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

示例1: execCreateAdmin

 private function execCreateAdmin()
 {
     $input = Input::only(['admin_username', 'admin_email', 'admin_password']);
     $adminUser = new User();
     if (strlen(trim(implode('', $input)))) {
         $adminUser->username = $input['admin_username'];
         $adminUser->email = $input['admin_email'];
         $adminUser->password = $input['admin_password'];
         $adminUser->is_admin = 1;
         $adminUser->is_active = 1;
         $adminUser->save();
         Config::set('microweber.has_admin', 1);
         Config::save();
         Auth::login($adminUser);
     }
 }
开发者ID:newaltcoin,项目名称:microweber,代码行数:16,代码来源:AdminController.php

示例2: mw

 function post_update($version = false)
 {
     $this->_log_msg('Applying post update actions');
     $system_refresh = new \Microweber\Install\DbInstaller();
     $system_refresh->createSchema();
     //$system_refresh->run();
     if (!ini_get('safe_mode')) {
         if (!strstr(INI_SYSTEM_CHECK_DISABLED, 'ini_set')) {
             ini_set("set_time_limit", 0);
         }
         if (!strstr(INI_SYSTEM_CHECK_DISABLED, 'set_time_limit')) {
             set_time_limit(0);
         }
     }
     mw()->cache_manager->delete('db');
     mw()->cache_manager->delete('update/global');
     mw()->cache_manager->delete('elements/global');
     mw()->cache_manager->delete('templates');
     mw()->cache_manager->delete('modules/global');
     mw()->cache_manager->clear();
     scan_for_modules();
     scan_for_elements();
     mw()->layouts_manager->scan();
     event_trigger('mw_db_init_default');
     event_trigger('mw_db_init_modules');
     event_trigger('mw_db_init');
     if ($version != false) {
         Config::set('microweber.version', $version);
         Config::save('microweber');
     }
 }
开发者ID:hyrmedia,项目名称:microweber,代码行数:31,代码来源:UpdateManager.php

示例3: save

 public function save()
 {
     return Config::save();
 }
开发者ID:MenZil-Team,项目名称:microweber,代码行数:4,代码来源:ConfigurationManager.php

示例4: index

 public function index($input = null)
 {
     if (!is_array($input) || empty($input)) {
         $input = Input::all();
     }
     $allowed_configs = array('database', 'microweber');
     $is_installed = mw_is_installed();
     if ($is_installed) {
         return 'Microweber is already installed!';
     }
     $view = MW_PATH . 'Views/install.php';
     $connection = Config::get('database.connections');
     $this->install_log("Preparing to install");
     if (isset($input['make_install'])) {
         if (!isset($input['db_pass'])) {
             $input['db_pass'] = '';
         }
         if (!isset($input['table_prefix'])) {
             $input['table_prefix'] = '';
         }
         $errors = array();
         if (!isset($input['db_host'])) {
             $errors[] = 'Parameter "db_host" is required';
         } else {
             $input['db_host'] = trim($input['db_host']);
         }
         if (!isset($input['db_name'])) {
             $errors[] = 'Parameter "db_name" is required';
         } else {
             $input['db_name'] = trim($input['db_name']);
         }
         if (!isset($input['db_user'])) {
             $errors[] = 'Parameter "db_user" is required';
         }
         if (!isset($input['admin_email'])) {
             $errors[] = 'Parameter "admin_email" is required';
         }
         if (!isset($input['admin_password'])) {
             $errors[] = 'Parameter "admin_password" is required';
         }
         if (!isset($input['admin_username'])) {
             $errors[] = 'Parameter "admin_username" is required';
         }
         if (!empty($errors)) {
             return implode("\n", $errors);
         }
         if (isset($input['db_driver'])) {
             $dbDriver = $input['db_driver'];
         } else {
             $dbDriver = 'mysql';
         }
         Config::set("database.default", $dbDriver);
         if ($dbDriver == 'sqlite') {
             if (isset($input['db_name_sqlite'])) {
                 $input['db_name'] = $input['db_name_sqlite'];
             }
             Config::set("database.connections.{$dbDriver}.database", $input['db_name']);
             if (!file_exists($input['db_name'])) {
                 touch($input['db_name']);
             }
         }
         Config::set("database.connections.{$dbDriver}.host", $input['db_host']);
         Config::set("database.connections.{$dbDriver}.username", $input['db_user']);
         Config::set("database.connections.{$dbDriver}.password", $input['db_pass']);
         Config::set("database.connections.{$dbDriver}.database", $input['db_name']);
         Config::set("database.connections.{$dbDriver}.prefix", $input['table_prefix']);
         if (isset($input['default_template']) and $input['default_template'] != false) {
             Config::set('microweber.install_default_template', $input['default_template']);
         }
         if (isset($input['with_default_content']) and $input['with_default_content'] != false) {
             Config::set('microweber.install_default_template_content', 1);
         }
         if (Config::get('app.key') == 'YourSecretKey!!!') {
             if (!$this->app->runningInConsole()) {
                 $_SERVER['argv'] = array();
             }
             Artisan::call('key:generate');
         }
         $this->install_log("Saving config");
         Config::save($allowed_configs);
         Cache::flush();
         $install_finished = false;
         try {
             DB::connection($dbDriver)->getDatabaseName();
         } catch (\PDOException $e) {
             return 'Error: ' . $e->getMessage() . "\n";
         } catch (\Exception $e) {
             return 'Error: ' . $e->getMessage() . "\n";
         }
         if (function_exists('set_time_limit')) {
             @set_time_limit(0);
         }
         $this->install_log("Setting up database");
         $installer = new Install\DbInstaller();
         $installer->run();
         $installer = new Install\WebserverInstaller();
         $installer->run();
         $this->install_log("Setting up template");
         $installer = new Install\TemplateInstaller();
         $installer->run();
//.........这里部分代码省略.........
开发者ID:newaltcoin,项目名称:microweber,代码行数:101,代码来源:InstallController.php


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