From 8a299654501db00316a56efda76448a6bb3975e1 Mon Sep 17 00:00:00 2001 From: nikrou Date: Mon, 16 Nov 2009 19:17:01 +0000 Subject: 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. git-svn-id: http://piwigo.org/svn/trunk@4280 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_upgrade.php | 2 +- include/common.inc.php | 6 +++--- include/config_default.inc.php | 5 ++++- include/constants.php | 2 +- install.php | 10 +++++----- install/db/65-database.php | 2 +- install/db/80-database.php | 6 +++--- install/upgrade_1.3.1.php | 4 ++-- language/de_DE/install.lang.php | 2 +- language/de_DE/upgrade.lang.php | 2 +- language/en_UK/install.lang.php | 2 +- language/en_UK/upgrade.lang.php | 2 +- language/es_ES/install.lang.php | 2 +- language/es_ES/upgrade.lang.php | 2 +- language/fr_FR/install.lang.php | 2 +- language/fr_FR/upgrade.lang.php | 2 +- language/it_IT/install.lang.php | 2 +- language/it_IT/upgrade.lang.php | 2 +- language/nl_NL/install.lang.php | 2 +- language/nl_NL/upgrade.lang.php | 2 +- language/pl_PL/install.lang.php | 2 +- language/pl_PL/upgrade.lang.php | 2 +- tools/pwg_rel_create.sh | 6 +++--- upgrade.php | 12 ++++++------ upgrade_feed.php | 6 +++--- 25 files changed, 46 insertions(+), 43 deletions(-) diff --git a/admin/include/functions_upgrade.php b/admin/include/functions_upgrade.php index c7aa23873..1d0fbd969 100644 --- a/admin/include/functions_upgrade.php +++ b/admin/include/functions_upgrade.php @@ -159,7 +159,7 @@ WHERE username = "'.$username.'" { $query = ' SELECT u.password, ui.status -FROM '.$conf['users_table'].' AS u +FROM '.USERS_TABLE.' AS u INNER JOIN '.USER_INFOS_TABLE.' AS ui ON u.'.$conf['user_fields']['id'].'=ui.user_id WHERE '.$conf['user_fields']['username'].'="'.$username.'" diff --git a/include/common.inc.php b/include/common.inc.php index 29bc6b29b..a0ec209ef 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -70,7 +70,7 @@ $header_msgs = array(); $header_notes = array(); $filter = array(); -@include(PHPWG_ROOT_PATH .'include/mysql.inc.php'); +@include(PHPWG_ROOT_PATH .'include/config_database.inc.php'); if (!defined('PHPWG_INSTALLED')) { header('Location: install.php'); @@ -104,8 +104,8 @@ include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); include( PHPWG_ROOT_PATH .'include/template.class.php'); // Database connection -@mysql_connect( $cfgHote, $cfgUser, $cfgPassword ) or my_error( 'mysql_connect', true ); -@mysql_select_db( $cfgBase ) or my_error( 'mysql_select_db', true ); +@mysql_connect( $conf['db_host'], $conf['db_user'], $conf['db_password'] ) or my_error( 'mysql_connect', true ); +@mysql_select_db( $conf['db_base'] ) or my_error( 'mysql_select_db', true ); defined('PWG_CHARSET') and defined('DB_CHARSET') or fatal_error('PWG_CHARSET and/or DB_CHARSET is not defined'); diff --git a/include/config_default.inc.php b/include/config_default.inc.php index a9ef63607..94fcdbb55 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -494,7 +494,10 @@ $conf['apache_authentication'] = false; // // All informations contained in these tables and column are related to // piwigo_users table. -$conf['users_table'] = $prefixeTable.'users'; +// +// You can use a different table for users, if you define associated constant +// default configuration : +// define('USERS_TABLE', $prefixeTable.'users'); // Other tables can be changed, if you define associated constants // Example: diff --git a/include/constants.php b/include/constants.php index 7e429a91c..9c29f0c91 100644 --- a/include/constants.php +++ b/include/constants.php @@ -68,7 +68,7 @@ if (!defined('USER_ACCESS_TABLE')) if (!defined('USER_GROUP_TABLE')) define('USER_GROUP_TABLE', $prefixeTable.'user_group'); if (!defined('USERS_TABLE')) - define('USERS_TABLE', $conf['users_table']); + define('USERS_TABLE', $prefixeTable.'users'); if (!defined('USER_INFOS_TABLE')) define('USER_INFOS_TABLE', $prefixeTable.'user_infos'); if (!defined('USER_FEED_TABLE')) diff --git a/install.php b/install.php index 2e82a9709..135c7fb47 100644 --- a/install.php +++ b/install.php @@ -168,7 +168,7 @@ $infos = array(); $errors = array(); // Open config.php ... if it exists -$config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php'; +$config_file = PHPWG_ROOT_PATH.'include/config_database.inc.php'; if (@file_exists($config_file)) { include($config_file); @@ -291,10 +291,10 @@ if ( isset( $_POST['install'] )) { $step = 2; $file_content = ' Forum Piwigo .'; $lang['install_end_message'] = 'Die Konfiguration der Piwigo abgeschlossen ist, hier ist der nächste Schritt

* Gehen Sie zum Anmelden auf die Startseite: [ Identifizierung ] und verwenden Sie die Login / Passwort für Webmaster
diff --git a/language/de_DE/upgrade.lang.php b/language/de_DE/upgrade.lang.php index 75b246eaf..117cb12ac 100644 --- a/language/de_DE/upgrade.lang.php +++ b/language/de_DE/upgrade.lang.php @@ -34,7 +34,7 @@ $lang['perform a maintenance check'] = 'Führen Sie einen Wartungs-Check am [Adm $lang['deactivated plugins'] = 'Als Vorsichtsmaßnahme folgenden Plugins wurden deaktiviert. Sie müssen prüfen, ob Plugins aktualisieren, bevor sie reactiving:'; $lang['upgrade login message'] = 'Nur Administrator können Upgrade ausführen : Bitte melden Sie sich an unter.'; $lang['You do not have access rights to run upgrade'] = 'Sie haben nicht das Recht auf Zugang zum Upgrade ausführen'; -$lang['in include/mysql.inc.php, before ?>, insert:'] = 'In include/mysql.inc.php, vor ?>, wird Folgendes eingefügt:'; +$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In include/config_database.inc.php, vor ?>, wird Folgendes eingefügt:'; // Upgrade informations from upgrade_1.3.1.php $lang['all sub-categories of private categories become private'] = 'Alle Unter-Kategorien von privaten Gruppen wirden privaten'; diff --git a/language/en_UK/install.lang.php b/language/en_UK/install.lang.php index a921e0c76..716393b7d 100644 --- a/language/en_UK/install.lang.php +++ b/language/en_UK/install.lang.php @@ -37,7 +37,7 @@ $lang['step1_err_db'] = 'Connection to server succeed, but it was impossible to $lang['step1_err_server'] = 'Can\'t connect to server'; $lang['step1_err_copy_2'] = 'The next step of the installation is now possible'; $lang['step1_err_copy_next'] = 'next step'; -$lang['step1_err_copy'] = 'Copy the text in pink between hyphens and paste it into the file "include/mysql.inc.php"(Warning : mysql.inc.php must only contain what is in pink, no line return or space character)'; +$lang['step1_err_copy'] = 'Copy the text in pink between hyphens and paste it into the file "include/config_database.inc.php"(Warning : config_database.inc.php must only contain what is in pink, no line return or space character)'; $lang['step1_host'] = 'MySQL host'; $lang['step1_host_info'] = 'localhost, sql.multimania.com, toto.freesurf.fr'; diff --git a/language/en_UK/upgrade.lang.php b/language/en_UK/upgrade.lang.php index 275bc8e2e..01f64e50d 100644 --- a/language/en_UK/upgrade.lang.php +++ b/language/en_UK/upgrade.lang.php @@ -34,7 +34,7 @@ $lang['perform a maintenance check'] = 'Perform a maintenance check in [Administ $lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:'; $lang['upgrade login message'] = 'Only administrator can run upgrade: please sign in below.'; $lang['You do not have access rights to run upgrade'] = 'You do not have access rights to run upgrade'; -$lang['in include/mysql.inc.php, before ?>, insert:'] = 'In include/mysql.inc.php, before ?>, insert:'; +$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In include/config_database.inc.php, before ?>, insert:'; // Upgrade informations from upgrade_1.3.1.php $lang['all sub-categories of private categories become private'] = 'All sub-categories of private categories become private'; diff --git a/language/es_ES/install.lang.php b/language/es_ES/install.lang.php index 8a9335716..e4d9d71e6 100644 --- a/language/es_ES/install.lang.php +++ b/language/es_ES/install.lang.php @@ -54,7 +54,7 @@ $lang['step2_pwd'] = 'Palabra de paso'; $lang['step2_pwd_info'] = 'Debe quedar confidencial, permite acceder al tabla de administración.'; $lang['step2_pwd_conf'] = 'Palabra de paso [Confirmar]'; $lang['step2_pwd_conf_info'] = 'Comprobación'; -$lang['step1_err_copy'] = 'Copie el texto en rosa entre las rayas y pegúelo en el fichero mysql.inc.php que se encuentra en el repertorio " include " a la base del lugar donde usted instaló a Piwigo (el fichero mysql.inc.php debe contener SÓLO lo que está en rosa entre las rayas, ninguna vuelta a la línea o espacio es autorizado)'; +$lang['step1_err_copy'] = 'Copie el texto en rosa entre las rayas y pegúelo en el fichero config_database.inc.php que se encuentra en el repertorio " include " a la base del lugar donde usted instaló a Piwigo (el fichero config_database.inc.php debe contener SÓLO lo que está en rosa entre las rayas, ninguna vuelta a la línea o espacio es autorizado)'; $lang['install_help'] = '¿ Necesidad de ayudante? Plantee su cuestión sobre él foro de Piwigo.'; $lang['install_end_message'] = 'La configuración de la aplicación correctamente se celebró, coloca en la etapa próxima

* Vaya sobre la página de identificación y conéctese con pseudo dado para el webmaster
diff --git a/language/es_ES/upgrade.lang.php b/language/es_ES/upgrade.lang.php index 1a9a24999..4177e4156 100644 --- a/language/es_ES/upgrade.lang.php +++ b/language/es_ES/upgrade.lang.php @@ -34,7 +34,7 @@ $lang['perform a maintenance check'] = 'Por favor, efectúes un mantenimiento en $lang['deactivated plugins'] = 'Por precaución, el plugins siguiente han sido desactivados. Verifique si existen unas posturas al día antes de reactivarlas:'; $lang['upgrade login message'] = 'Sólo un administrador puede lanzar la puesta al día: por favor, identifiqúese más abajo.'; $lang['You do not have access rights to run upgrade'] = 'Usted no tiene los derechos necessaires para lanzar la puesta al día.'; -/* TODO */$lang['in include/mysql.inc.php, before ?>, insert:'] = 'In include/mysql.inc.php, before ?>, insert:'; +/* TODO */$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In include/config_database.inc.php, before ?>, insert:'; // Upgrade informations from upgrade_1.3.1.php $lang['all sub-categories of private categories become private'] = 'Todas las subcategorías de categorías privadas se vuelven privadas'; diff --git a/language/fr_FR/install.lang.php b/language/fr_FR/install.lang.php index 6a593ab32..860dd7b4a 100644 --- a/language/fr_FR/install.lang.php +++ b/language/fr_FR/install.lang.php @@ -54,7 +54,7 @@ $lang['step2_pwd'] = 'Mot de passe'; $lang['step2_pwd_info'] = 'Il doit rester confidentiel, il permet d\'accéder au panneau d\'administration.'; $lang['step2_pwd_conf'] = 'Mot de passe [ Confirmer ]'; $lang['step2_pwd_conf_info'] = 'Vérification'; -$lang['step1_err_copy'] = 'Copiez le texte en rose entre les tirets et collez-le dans le fichier mysql.inc.php qui se trouve dans le répertoire "include" à la base de l\'endroit où vous avez installé Piwigo (le fichier mysql.inc.php ne doit comporter QUE ce qui est en rose entre les tirets, aucun retour à la ligne ou espace n\'est autorisé)'; +$lang['step1_err_copy'] = 'Copiez le texte en rose entre les tirets et collez-le dans le fichier config_database.inc.php qui se trouve dans le répertoire "include" à la base de l\'endroit où vous avez installé Piwigo (le fichier config_database.inc.php ne doit comporter QUE ce qui est en rose entre les tirets, aucun retour à la ligne ou espace n\'est autorisé)'; $lang['install_help'] = 'Besoin d\'aide ? Posez votre question sur le forum de Piwigo.'; $lang['install_end_message'] = 'La configuration de l\'application s\'est correctement déroulée, place à la prochaine étape

* allez sur la page d\'identification et connectez-vous avec le pseudo donné pour le webmaster
diff --git a/language/fr_FR/upgrade.lang.php b/language/fr_FR/upgrade.lang.php index 565c8c606..83a7c90ca 100644 --- a/language/fr_FR/upgrade.lang.php +++ b/language/fr_FR/upgrade.lang.php @@ -34,7 +34,7 @@ $lang['perform a maintenance check'] = 'Veuillez effectuer une maintenance dans $lang['deactivated plugins'] = 'Par précaution, les plugins suivants ont été désactivés. Vérifiez s\'il existe des mises à jour avant de les réactiver:'; $lang['upgrade login message'] = 'Seul un administrateur peut lancer la mise à jour: veuillez vous identifier ci-dessous.'; $lang['You do not have access rights to run upgrade'] = 'Vous n\'avez pas les droits necessaires pour lancer la mise à jour.'; -$lang['in include/mysql.inc.php, before ?>, insert:'] = 'Dans le fichier include/mysql.inc.php, avant ?>, insérez:'; +$lang['in include/config_database.inc.php, before ?>, insert:'] = 'Dans le fichier include/config_database.inc.php, avant ?>, insérez:'; // Upgrade informations from upgrade_1.3.1.php $lang['all sub-categories of private categories become private'] = 'Toutes les sous-catégories de catégories privées deviennent privées'; diff --git a/language/it_IT/install.lang.php b/language/it_IT/install.lang.php index 7c524c3aa..1072bbe64 100644 --- a/language/it_IT/install.lang.php +++ b/language/it_IT/install.lang.php @@ -54,7 +54,7 @@ $lang['step2_pwd'] = 'Password'; $lang['step2_pwd_info'] = 'da conservare con cura. Permette l\'accesso al pannello di amministrazione'; $lang['step2_pwd_conf'] = 'Password [confermare]'; $lang['step2_pwd_conf_info'] = 'verifica'; -$lang['step1_err_copy'] = 'Copiate il testo in rosa trà i trattini e mettetelo nel file mysql.inc.php che si trova nella directory "include" alla base del vostro sito dove aveto installato Piwigo (il file mysql.inc.php non deve contenere altro che ciò che è in rosa tra i trattini, nessun ritorno a capo o spazio è autorizzato)'; +$lang['step1_err_copy'] = 'Copiate il testo in rosa trà i trattini e mettetelo nel file config_database.inc.php che si trova nella directory "include" alla base del vostro sito dove aveto installato Piwigo (il file config_database.inc.php non deve contenere altro che ciò che è in rosa tra i trattini, nessun ritorno a capo o spazio è autorizzato)'; $lang['install_help'] = 'Bisogno di un aiuto? Visitate il forum di Piwigo.'; $lang['install_end_message'] = 'La configurazione di Piwigo è conclusa. Procedete al prossimo step

* collegatevi alla pagina d\'accesso e usare come nome d\'utente e password quello del Webmaster
diff --git a/language/it_IT/upgrade.lang.php b/language/it_IT/upgrade.lang.php index e0f247c40..cebda9ca6 100644 --- a/language/it_IT/upgrade.lang.php +++ b/language/it_IT/upgrade.lang.php @@ -34,7 +34,7 @@ $lang['perform a maintenance check'] = 'Se riscontrate dei problemi, effettuare $lang['deactivated plugins'] = 'Per precauzione, i plugins sono stati disattivati. Verificate se non esistono degli aggiornamenti prima di riattivarli:'; $lang['upgrade login message'] = 'Solo un\'amministratore può eseguire l\'aggiornamento: identificatevi.'; $lang['You do not have access rights to run upgrade'] = 'Non avete le autorizzazioni necessarie per effettuare l\'aggiornamento'; -$lang['in include/mysql.inc.php, before ?>, insert:'] = 'Nel file include/mysql.inc.php, prima di ?>, inserire:'; +$lang['in include/config_database.inc.php, before ?>, insert:'] = 'Nel file include/config_database.inc.php, prima di ?>, inserire:'; // Upgrade informations from upgrade_1.3.1.php $lang['all sub-categories of private categories become private'] = 'Tutte le sottocategorie delle categorie private diventono private'; diff --git a/language/nl_NL/install.lang.php b/language/nl_NL/install.lang.php index e8399e473..e0f635207 100644 --- a/language/nl_NL/install.lang.php +++ b/language/nl_NL/install.lang.php @@ -37,7 +37,7 @@ $lang['step1_err_db'] = 'De verbinding met de server is geslaagd, maar het is ni $lang['step1_err_server'] = 'Geen verbinding met de server'; $lang['step1_err_copy_2'] = 'Het is nu mogelijk om verder te gaan met de volgende stap van de installatie'; $lang['step1_err_copy_next'] = 'volgende stap'; -$lang['step1_err_copy'] = 'Kopieer de tekst tussen de lijnen en plak deze in het bestand "include/mysql.inc.php"(Waarschuwing: mysql.inc.php mag alleen het roze gedeelte bevatten, geen return of extra spatie). Dit moet alleen wanneer dit bestand geen schrijfrechten'; +$lang['step1_err_copy'] = 'Kopieer de tekst tussen de lijnen en plak deze in het bestand "include/config_database.inc.php"(Waarschuwing: config_database.inc.php mag alleen het roze gedeelte bevatten, geen return of extra spatie). Dit moet alleen wanneer dit bestand geen schrijfrechten'; $lang['step1_host'] = 'MySQL host'; $lang['step1_host_info'] = 'localhost, sql.multimania.com, toto.freesurf.fr'; diff --git a/language/nl_NL/upgrade.lang.php b/language/nl_NL/upgrade.lang.php index 87a6ddb29..ba1d1c9d6 100644 --- a/language/nl_NL/upgrade.lang.php +++ b/language/nl_NL/upgrade.lang.php @@ -35,7 +35,7 @@ $lang['perform a maintenance check'] = 'Perform a maintenance check in [Administ $lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:'; $lang['upgrade login message'] = 'Only administrator can run upgrade: please sign in below.'; $lang['You do not have access rights to run upgrade'] = 'You do not have access rights to run upgrade'; -$lang['in include/mysql.inc.php, before ?>, insert:'] = 'In include/mysql.inc.php, before ?>, insert:'; +$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In include/config_database.inc.php, before ?>, insert:'; // Upgrade informations from upgrade_1.3.1.php $lang['all sub-categories of private categories become private'] = 'All sub-categories of private categories become private'; diff --git a/language/pl_PL/install.lang.php b/language/pl_PL/install.lang.php index 37ada6308..266b70c09 100644 --- a/language/pl_PL/install.lang.php +++ b/language/pl_PL/install.lang.php @@ -37,7 +37,7 @@ $lang['step1_err_db'] = 'PoÅ‚Ä…czenie do serwera powiodÅ‚o siÄ™, ale nie byÅ‚o m $lang['step1_err_server'] = 'Nie można poÅ‚Ä…czyć sie do serwera'; $lang['step1_err_copy_2'] = 'Teraz mozliwy jest nastÄ™pny krok instalacji'; $lang['step1_err_copy_next'] = 'nastÄ™pny krok'; -$lang['step1_err_copy'] = 'Skopiuj tekst zaznaczony na różowo pomiÄ™dzy cudzysÅ‚owiami i wklej do pliku "include/mysql.inc.php"(Uwaga : mysql.inc.php musi zawierać tylko to co jest na różowo bez żadnych znaków koÅ„ca linii czy spacji)'; +$lang['step1_err_copy'] = 'Skopiuj tekst zaznaczony na różowo pomiÄ™dzy cudzysÅ‚owiami i wklej do pliku "include/config_database.inc.php"(Uwaga : config_database.inc.php musi zawierać tylko to co jest na różowo bez żadnych znaków koÅ„ca linii czy spacji)'; $lang['step1_host'] = 'MySQL host'; $lang['step1_host_info'] = 'localhost, sql.multimania.com, toto.freesurf.fr'; diff --git a/language/pl_PL/upgrade.lang.php b/language/pl_PL/upgrade.lang.php index 2dcdad47d..ec4d32887 100644 --- a/language/pl_PL/upgrade.lang.php +++ b/language/pl_PL/upgrade.lang.php @@ -34,7 +34,7 @@ $lang['perform a maintenance check'] = 'Jeżeli napotkasz jakiÅ› problem wykonaj $lang['deactivated plugins'] = 'W ramach zabezpieczenia zostÄ…Å‚y deaktywowane nastÄ™pujÄ…ce wtyczki. Przed ich ponownÄ… aktywacjÄ… musisz sprawdzić dostÄ™pność aktualizacji dla nich:'; $lang['upgrade login message'] = 'Tylko administrator może wykonać aktualizacjÄ™: zaloguj siÄ™ poniżej.'; $lang['You do not have access rights to run upgrade'] = 'Nie masz uprawnieÅ„ do wykonania aktualizacji'; -$lang['in include/mysql.inc.php, before ?>, insert:'] = 'W pliku include/mysql.inc.php, przed ?>, wstaw:'; +$lang['in include/config_database.inc.php, before ?>, insert:'] = 'W pliku include/config_database.inc.php, przed ?>, wstaw:'; // Upgrade informations from upgrade_1.3.1.php $lang['all sub-categories of private categories become private'] = 'Wszystkie podkategorie kategorii prywatnych stanÄ… siÄ™ prywatne'; diff --git a/tools/pwg_rel_create.sh b/tools/pwg_rel_create.sh index 0dadbe759..424b703d9 100755 --- a/tools/pwg_rel_create.sh +++ b/tools/pwg_rel_create.sh @@ -34,9 +34,9 @@ mkdir $version # cvs export -r $tag -d $version phpwebgallery svn export http://piwigo.org/svn/tags/$tag $name -# creating mysql.inc.php empty and writeable -touch $name/include/mysql.inc.php -chmod a+w $name/include/mysql.inc.php +# creating config_database.inc.php empty and writeable +touch $name/include/config_database.inc.php +chmod a+w $name/include/config_database.inc.php # find $name -name "*.php" \ # | xargs grep -l 'branch 1.7' \ diff --git a/upgrade.php b/upgrade.php index 5dc698f3c..a425ec731 100644 --- a/upgrade.php +++ b/upgrade.php @@ -24,7 +24,7 @@ define('PHPWG_ROOT_PATH', './'); // load config file -$config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php'; +$config_file = PHPWG_ROOT_PATH.'include/config_database.inc.php'; $config_file_contents = @file_get_contents($config_file); if ($config_file_contents === false) { @@ -40,7 +40,7 @@ include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); -include(PHPWG_ROOT_PATH.'include/mysql.inc.php'); +include(PHPWG_ROOT_PATH.'include/config_database.inc.php'); include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); @include(PHPWG_ROOT_PATH. 'include/config_local.inc.php'); @@ -50,8 +50,8 @@ include_once(PHPWG_ROOT_PATH.'include/constants.php'); define('PREFIX_TABLE', $prefixeTable); // Database connection -mysql_connect( $cfgHote, $cfgUser, $cfgPassword ) or die ( "Could not connect to database server" ); -mysql_select_db( $cfgBase ) or die ( "Could not connect to database" ); +mysql_connect( $conf['db_host'], $conf['db_user'], $conf['db_password'] ) or die ( "Could not connect to database server" ); +mysql_select_db( $conf['db_base'] ) or die ( "Could not connect to database" ); if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') and defined('DB_CHARSET') and DB_CHARSET!='' ) { @@ -262,7 +262,7 @@ if (isset($_POST['submit']) and check_upgrade()) $conf['die_on_sql_error'] = false; include($upgrade_file); - // Something to add in mysql.inc.php? + // Something to add in config_database.inc.php? if (!empty($mysql_changes)) { $config_file_contents = @@ -273,7 +273,7 @@ if (isset($_POST['submit']) and check_upgrade()) if (!@file_put_contents($config_file, $config_file_contents)) { array_push($page['infos'], - l10n('in include/mysql.inc.php, before ?>, insert:') . ' + l10n('in include/config_database.inc.php, before ?>, insert:') . '

' ); } diff --git a/upgrade_feed.php b/upgrade_feed.php index 4d70d66bb..21b10393d 100644 --- a/upgrade_feed.php +++ b/upgrade_feed.php @@ -32,7 +32,7 @@ define('PHPWG_ROOT_PATH', './'); include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); -include(PHPWG_ROOT_PATH.'include/mysql.inc.php'); +include(PHPWG_ROOT_PATH.'include/config_database.inc.php'); include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); @include(PHPWG_ROOT_PATH. 'include/config_local.inc.php'); @@ -54,8 +54,8 @@ define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db'); // | Database connection | // +-----------------------------------------------------------------------+ -mysql_connect($cfgHote, $cfgUser, $cfgPassword) or die("Could not connect to database server"); -mysql_select_db($cfgBase) or die("Could not connect to database"); +mysql_connect($conf['db_host'], $conf['db_user'], $conf['db_password']) or die("Could not connect to database server"); +mysql_select_db($conf['db_base']) or die("Could not connect to database"); if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') and defined('DB_CHARSET') and DB_CHARSET!='' ) { -- cgit v1.2.3