Changeset 4280 for trunk/upgrade.php


Ignore:
Timestamp:
Nov 16, 2009, 8:17:01 PM (14 years ago)
Author:
nikrou
Message:

Feature 928 resolved.
Replace include/mysql.inc.php by include/config_database.inc.php to be independant of database engine
Rename database configurations variables by ones in $conf array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/upgrade.php

    r3282 r4280  
    2525
    2626// load config file
    27 $config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php';
     27$config_file = PHPWG_ROOT_PATH.'include/config_database.inc.php';
    2828$config_file_contents = @file_get_contents($config_file);
    2929if ($config_file_contents === false)
     
    4141include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php');
    4242
    43 include(PHPWG_ROOT_PATH.'include/mysql.inc.php');
     43include(PHPWG_ROOT_PATH.'include/config_database.inc.php');
    4444include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
    4545@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
     
    5151
    5252// Database connection
    53 mysql_connect( $cfgHote, $cfgUser, $cfgPassword ) or die ( "Could not connect to database server" );
    54 mysql_select_db( $cfgBase ) or die ( "Could not connect to database" );
     53mysql_connect( $conf['db_host'], $conf['db_user'], $conf['db_password'] ) or die ( "Could not connect to database server" );
     54mysql_select_db( $conf['db_base'] ) or die ( "Could not connect to database" );
    5555if ( version_compare(mysql_get_server_info(), '4.1.0', '>=')
    5656    and defined('DB_CHARSET') and DB_CHARSET!='' )
     
    263263    include($upgrade_file);
    264264
    265     // Something to add in mysql.inc.php?
     265    // Something to add in config_database.inc.php?
    266266    if (!empty($mysql_changes))
    267267    {
     
    274274      {
    275275        array_push($page['infos'],
    276           l10n('in include/mysql.inc.php, before ?>, insert:') . '
     276          l10n('in include/config_database.inc.php, before ?>, insert:') . '
    277277<p><textarea rows="4" cols="40">'.implode("\r\n" , $mysql_changes).'</textarea></p>'
    278278          );
Note: See TracChangeset for help on using the changeset viewer.