本文整理匯總了PHP中Install::setDatabaseDriver方法的典型用法代碼示例。如果您正苦於以下問題:PHP Install::setDatabaseDriver方法的具體用法?PHP Install::setDatabaseDriver怎麽用?PHP Install::setDatabaseDriver使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Install
的用法示例。
在下文中一共展示了Install::setDatabaseDriver方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
case 'back':
Debug::Text('Back', __FILE__, __LINE__, __METHOD__, 10);
Redirect::Page(URLBuilder::getURL(NULL, 'Requirements.php'));
break;
case 'next':
Debug::Text('Next', __FILE__, __LINE__, __METHOD__, 10);
//Debug::setVerbosity(11);
if (isset($data) and isset($data['priv_user']) and isset($data['priv_password']) and $data['priv_user'] != '' and $data['priv_password'] != '') {
$tmp_user_name = $data['priv_user'];
$tmp_password = $data['priv_password'];
} elseif (isset($data)) {
$tmp_user_name = $data['user'];
$tmp_password = $data['password'];
}
$test_db_connection = $install_obj->setNewDatabaseConnection($data['final_type'], $data['final_host'], $tmp_user_name, $tmp_password, '');
$install_obj->setDatabaseDriver($data['final_type']);
if ($install_obj->checkDatabaseExists($data['database_name']) == FALSE) {
Debug::Text('Creating Database', __FILE__, __LINE__, __METHOD__, 10);
$install_obj->createDatabase($data['database_name']);
}
//Make sure InnoDB engine exists on MySQL
if ($install_obj->getDatabaseType() != 'mysql' or $install_obj->getDatabaseType() == 'mysql' and $install_obj->checkDatabaseEngine() == TRUE) {
//Check again to make sure database exists.
$db_connection = $install_obj->setNewDatabaseConnection($data['final_type'], $data['final_host'], $tmp_user_name, $tmp_password, $data['database_name']);
if ($install_obj->checkDatabaseExists($data['database_name']) == TRUE) {
//Create SQL
Debug::Text('yDatabase does exist...', __FILE__, __LINE__, __METHOD__, 10);
$data['type'] = $data['final_type'];
$data['host'] = $data['final_host'];
$install_obj->writeConfigFile($data);
//Redirect::Page( URLBuilder::getURL( array('action' => 'install_schema'), 'DatabaseSchema.php') );
示例2: InitProgressBar
}
$action = Misc::findSubmitButton();
switch ($action) {
case 'install_schema':
//Need to create the tables after the database
//exists and Database.inc.php has made a connection.
//Otherwise we can't use objects yet.
//Debug::setVerbosity(11);
Debug::Text('Install Schema', __FILE__, __LINE__, __METHOD__, 10);
InitProgressBar();
$progress_bar->setValue(1);
$progress_bar->display();
if ($install_obj->checkDatabaseExists($config_vars['database']['database_name']) == TRUE) {
//Create SQL, always try to install every schema version, as
//installSchema() will check if its already been installed or not.
$install_obj->setDatabaseDriver($config_vars['database']['type']);
$install_obj->createSchemaRange(NULL, NULL);
//All schema versions
//FIXME: Notify the user of any errors.
$install_obj->setVersions();
} else {
Debug::Text('bDatabase does not exist.', __FILE__, __LINE__, __METHOD__, 10);
}
$progress_bar->setValue(100);
$progress_bar->display();
if ($install_obj->getIsUpgrade() == TRUE) {
//Make sure when using external installer that update notifications are always enabled.
$sslf = new SystemSettingListFactory();
$sslf->getByName('update_notify');
if ($sslf->getRecordCount() == 1) {
$obj = $sslf->getCurrent();