當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Install::checkDatabaseExists方法代碼示例

本文整理匯總了PHP中Install::checkDatabaseExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Install::checkDatabaseExists方法的具體用法?PHP Install::checkDatabaseExists怎麽用?PHP Install::checkDatabaseExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Install的用法示例。


在下文中一共展示了Install::checkDatabaseExists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

     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') );
             Redirect::Page(URLBuilder::getURL(array('external_installer' => $external_installer), 'DatabaseSchema.php'));
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:31,代碼來源:DatabaseConfig.php

示例2: Install

 *
 */
$smarty->assign('title', TTi18n::gettext($title = '3. Database Configuration'));
// See index.php
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('action', 'data', 'external_installer')));
$install_obj = new Install();
if ($install_obj->isInstallMode() == FALSE) {
    Redirect::Page(URLBuilder::getURL(NULL, 'install.php'));
}
$database_engine = TRUE;
$install_obj->setDatabaseConnection($db);
//Default connection
if ($install_obj->checkDatabaseExists($config_vars['database']['database_name']) == TRUE) {
    if ($install_obj->checkTableExists('system_setting') == TRUE) {
        $install_obj->setIsUpgrade(TRUE);
        //$upgrade = TRUE;
    } else {
        $install_obj->setIsUpgrade(FALSE);
        //$upgrade = FALSE;
    }
}
$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);
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:31,代碼來源:DatabaseSchema.php


注:本文中的Install::checkDatabaseExists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。