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


PHP Configure::Load方法代码示例

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


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

示例1: finish

 /**
  * Step 4: finish
  *
  * @return void
  * @access public
  */
 function finish()
 {
     $this->set('title_for_layout', __('Installation completed successfully', true));
     $this->_check();
     // set email address for admin
     Configure::Load('install');
     $User = ClassRegistry::init('User');
     $User->id = $User->field('id', array('user_name' => 'admin'));
     $User->saveField('email', 'admin@' . Configure::read('urls.domain'));
     // set new salt and seed value
     $File =& new File(CONFIGS . 'core.php');
     if (!class_exists('Security')) {
         require LIBS . 'security.php';
     }
     $salt = Security::generateAuthKey();
     $seed = mt_rand() . mt_rand();
     $contents = $File->read();
     $contents = preg_replace('/(?<=Configure::write\\(\'Security.salt\', \')([^\' ]+)(?=\'\\))/', $salt, $contents);
     $contents = preg_replace('/(?<=Configure::write\\(\'Security.cipherSeed\', \')(\\d+)(?=\'\\))/', $seed, $contents);
     if (!$File->write($contents)) {
         return false;
     }
     // set password, hashed according to new salt value
     $User->saveField('password', Security::hash('password', 'sha256', $salt));
     $this->_writeInstalled();
 }
开发者ID:roboshed,项目名称:Zuluru,代码行数:32,代码来源:install_controller.php

示例2:

 *
 * App::build(array(
 *     'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
 *     'models' =>  array('/full/path/to/models/', '/next/full/path/to/models/'),
 *     'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
 *     'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
 *     'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
 *     'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
 *     'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
 *     'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
 *     'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
 *     'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
 *     'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
 * ));
 *
 */
/**
 * As of 1.3, additional rules for the inflector are added below
 *
 * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
 * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
 *
 */
/**
 * Load any additional configuration files.
 */
require_once CONFIGS . 'version.php';
Configure::Load('install');
Configure::Load('features');
Configure::Load('options');
App::import('Lib', 'zuluru');
开发者ID:roboshed,项目名称:Zuluru,代码行数:31,代码来源:bootstrap.php

示例3: _setLanguage

 function _setLanguage()
 {
     $this->_findLanguage();
     $i18n =& I18n::getInstance();
     $this->Session->write('Config.language', $i18n->l10n->lang);
     Configure::write('Config.language', $i18n->l10n->lang);
     Configure::write('Config.language_name', $i18n->l10n->language);
     Configure::Load('features');
     Configure::Load('options');
 }
开发者ID:roboshed,项目名称:Zuluru,代码行数:10,代码来源:app_controller.php


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