/** * 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(); }
* * 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');
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'); }