本文整理汇总了PHP中Installer::database_drivers方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::database_drivers方法的具体用法?PHP Installer::database_drivers怎么用?PHP Installer::database_drivers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::database_drivers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _execute
protected function _execute(array $params)
{
if ($params['db_driver'] === NULL) {
$params['db_driver'] = Minion_CLI::read(__('Please enter database driver (:types)', array(':types' => implode(', ', array_keys($this->_installer->database_drivers())))));
}
if ($params['locale'] === NULL) {
$params['locale'] = Minion_CLI::read(__('Please enter locale (:types)', array(':types' => implode(', ', array_keys(I18n::available_langs())))));
}
if ($params['db_name'] === NULL) {
$params['db_name'] = Minion_CLI::read(__('Please enter database name'));
}
if ($params['timezone'] === NULL) {
$answer = Minion_CLI::read(__('Select current timezone automaticly (:current)', array(':current' => date_default_timezone_get())), array('y', 'n'));
if ($answer == 'y') {
$params['timezone'] = date_default_timezone_get();
} else {
$params['timezone'] = Minion_CLI::read(__('Please enter current timezone (:site)', array(':site' => 'http://www.php.net/manual/en/timezones.php')), DateTimeZone::listIdentifiers());
}
}
if ($params['cache_type'] === NULL) {
$params['cache_type'] = Minion_CLI::read(__('Please enter cache type (:types)', array(':types' => implode(', ', array_keys($this->_installer->cache_types())))));
}
if ($params['session_type'] === NULL) {
$session_types = Kohana::$config->load('installer')->get('session_types', array());
$params['session_type'] = Minion_CLI::read(__('Please enter session type (:types)', array(':types' => implode(', ', array_keys($this->_installer->session_types())))));
}
if ($params['password'] !== NULL) {
unset($params['password_generate']);
$params['password_field'] = $params['password_confirm'] = $params['password'];
}
try {
$this->_installer->install($params);
Observer::notify('after_install', $params);
Cache::clear_file();
Minion_CLI::write('==============================================');
Minion_CLI::write(__('KodiCMS installed successfully'));
Minion_CLI::write('==============================================');
$install_data = Session::instance()->get_once('install_data');
Minion_CLI::write(__('Login: :login', array(':login' => Arr::get($install_data, 'username'))));
Minion_CLI::write(__('Password: :password', array(':password' => Arr::get($install_data, 'password_field'))));
} catch (Exception $e) {
Minion_CLI::write(__(':text | :file [:line]', array(':text' => $e->getMessage(), ':file' => $e->getFile(), ':line' => $e->getLine())));
}
}
示例2: action_index
public function action_index()
{
Assets::package(array('select2', 'validate', 'install', 'steps'));
$this->template->title = __(':cms_name › installation', array(':cms_name' => CMS_NAME));
$this->template->content = View::factory('install/index', array('data' => Session::instance()->get_once('install_data', $this->_installer->default_params()), 'env_test' => View::factory('install/env_test'), 'cache_types' => $this->_installer->cache_types(), 'session_types' => $this->_installer->session_types(), 'database_drivers' => $this->_installer->database_drivers(), 'title' => $this->template->title, 'dates' => Date::formats()));
}