本文整理汇总了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();
}
示例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');
示例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');
}