Changeset 4280


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.

Location:
trunk
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upgrade.php

    r4006 r4280  
    160160    $query = '
    161161SELECT u.password, ui.status
    162 FROM '.$conf['users_table'].' AS u
     162FROM '.USERS_TABLE.' AS u
    163163INNER JOIN '.USER_INFOS_TABLE.' AS ui
    164164ON u.'.$conf['user_fields']['id'].'=ui.user_id
  • trunk/include/common.inc.php

    r4047 r4280  
    7171$filter = array();
    7272
    73 @include(PHPWG_ROOT_PATH .'include/mysql.inc.php');
     73@include(PHPWG_ROOT_PATH .'include/config_database.inc.php');
    7474if (!defined('PHPWG_INSTALLED'))
    7575{
     
    105105
    106106// Database connection
    107 @mysql_connect( $cfgHote, $cfgUser, $cfgPassword ) or my_error( 'mysql_connect', true );
    108 @mysql_select_db( $cfgBase ) or my_error( 'mysql_select_db', true );
     107@mysql_connect( $conf['db_host'], $conf['db_user'], $conf['db_password'] ) or my_error( 'mysql_connect', true );
     108@mysql_select_db( $conf['db_base'] ) or my_error( 'mysql_select_db', true );
    109109
    110110defined('PWG_CHARSET') and defined('DB_CHARSET')
  • trunk/include/config_default.inc.php

    r3938 r4280  
    495495// All informations contained in these tables and column are related to
    496496// piwigo_users table.
    497 $conf['users_table'] = $prefixeTable.'users';
     497//
     498// You can use a different table for users, if you define associated constant
     499// default configuration :
     500// define('USERS_TABLE', $prefixeTable.'users');
    498501
    499502// Other tables can be changed, if you define associated constants
  • trunk/include/constants.php

    r3282 r4280  
    6969  define('USER_GROUP_TABLE', $prefixeTable.'user_group');
    7070if (!defined('USERS_TABLE'))
    71   define('USERS_TABLE', $conf['users_table']);
     71  define('USERS_TABLE', $prefixeTable.'users');
    7272if (!defined('USER_INFOS_TABLE'))
    7373  define('USER_INFOS_TABLE', $prefixeTable.'user_infos');
  • trunk/install.php

    r4047 r4280  
    169169
    170170// Open config.php ... if it exists
    171 $config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php';
     171$config_file = PHPWG_ROOT_PATH.'include/config_database.inc.php';
    172172if (@file_exists($config_file))
    173173{
     
    292292    $step = 2;
    293293    $file_content = '<?php
    294 $cfgBase = \''.$dbname.'\';
    295 $cfgUser = \''.$dbuser.'\';
    296 $cfgPassword = \''.$dbpasswd.'\';
    297 $cfgHote = \''.$dbhost.'\';
     294$conf[\'db_base\'] = \''.$dbname.'\';
     295$conf[\'db_user\'] = \''.$dbuser.'\';
     296$conf[\'db_password\'] = \''.$dbpasswd.'\';
     297$conf[\'db_host\'] = \''.$dbhost.'\';
    298298
    299299$prefixeTable = \''.$table_prefix.'\';
  • trunk/install/db/65-database.php

    r4265 r4280  
    256256
    257257// +-----------------------------------------------------------------------+
    258 // changes to write in mysql.inc.php
     258// changes to write in config_database.inc.php
    259259  array_push($mysql_changes,
    260260'define(\'PWG_CHARSET\', \''.$pwg_charset.'\');
  • trunk/install/db/80-database.php

    r3282 r4280  
    174174'include_phpwebgallery/config.php',
    175175'include_phpwebgallery/index.htm',
    176 'include_phpwebgallery/mysql.inc.php',
     176'include_phpwebgallery/config_database.inc.php',
    177177'index.htm',
    178178// Comparison between phpwebgallery-1.2.1 and phpwebgallery-1.1.0
     
    928928'admin/template/goto/theme/roma/images/bottom-left-bg.png',
    929929'admin/template/goto/theme/roma/images/top-left-bg.png',
    930 'include/mysql.inc.php',
     930'include/config_database.inc.php',
    931931'template-common/lib/ui/ui.accordion.packed.js',
    932932'template-common/lib/ui/ui.core.packed.js',
     
    944944
    945945$list_exlude_files = array(
    946 'include/mysql.inc.php',
     946'include/config_database.inc.php',
    947947);
    948948
  • trunk/install/upgrade_1.3.1.php

    r4265 r4280  
    580580
    581581// load the config file
    582 $config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php';
     582$config_file = PHPWG_ROOT_PATH.'include/config_database.inc.php';
    583583$config_file_contents = @file_get_contents($config_file);
    584584if ($config_file_contents === false)
     
    596596}
    597597
    598 // changes to write in mysql.inc.php
     598// changes to write in config_database.inc.php
    599599array_push($mysql_changes, 'define(\'PHPWG_INSTALLED\', true);');
    600600
  • trunk/language/de_DE/install.lang.php

    r3639 r4280  
    5555$lang['step2_pwd_conf'] = 'Passwort [Best&auml;tigung]';
    5656$lang['step2_pwd_conf_info'] = 'Wiederholen Sie das eingegebene Passwort';
    57 $lang['step1_err_copy'] = 'Kopieren Sie den rosa Text ohne die Bindestriche und fügen Sie ihn in die Datei "include / mysql.inc.php" auf dem Webserver ein (Warnung: die Datei "mysql.inc.php" darf nur die rosa Zeichen enthalten, nicht mehr und nicht weniger)';
     57$lang['step1_err_copy'] = 'Kopieren Sie den rosa Text ohne die Bindestriche und fügen Sie ihn in die Datei "include / config_database.inc.php" auf dem Webserver ein (Warnung: die Datei "config_database.inc.php" darf nur die rosa Zeichen enthalten, nicht mehr und nicht weniger)';
    5858$lang['install_help'] = 'Brauchen Sie Hilfe? Stellen Sie Ihre Frage auf der <a href="%s"> Forum Piwigo </a>.';
    5959$lang['install_end_message'] = 'Die Konfiguration der Piwigo abgeschlossen ist, hier ist der n&auml;chste Schritt<br><br>
  • trunk/language/de_DE/upgrade.lang.php

    r3282 r4280  
    3535$lang['upgrade login message'] = 'Nur Administrator können Upgrade ausführen : Bitte melden Sie sich an unter.';
    3636$lang['You do not have access rights to run upgrade'] = 'Sie haben nicht das Recht auf Zugang zum Upgrade ausführen';
    37 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, vor <b>?></b>, wird Folgendes eingefügt:';
     37$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In <i>include/config_database.inc.php</i>, vor <b>?></b>, wird Folgendes eingefügt:';
    3838
    3939// Upgrade informations from upgrade_1.3.1.php
  • trunk/language/en_UK/install.lang.php

    r3282 r4280  
    3838$lang['step1_err_copy_2'] = 'The next step of the installation is now possible';
    3939$lang['step1_err_copy_next'] = 'next step';
    40 $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)';
     40$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)';
    4141
    4242$lang['step1_host'] = 'MySQL host';
  • trunk/language/en_UK/upgrade.lang.php

    r3282 r4280  
    3535$lang['upgrade login message'] = 'Only administrator can run upgrade: please sign in below.';
    3636$lang['You do not have access rights to run upgrade'] = 'You do not have access rights to run upgrade';
    37 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, before <b>?></b>, insert:';
     37$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In <i>include/config_database.inc.php</i>, before <b>?></b>, insert:';
    3838
    3939// Upgrade informations from upgrade_1.3.1.php
  • trunk/language/es_ES/install.lang.php

    r3282 r4280  
    5555$lang['step2_pwd_conf'] = 'Palabra de paso [Confirmar]';
    5656$lang['step2_pwd_conf_info'] = 'Comprobación';
    57 $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)';
     57$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)';
    5858$lang['install_help'] = '¿ Necesidad de ayudante? Plantee su cuestión sobre él <a href="%s">foro de Piwigo</a>.';
    5959$lang['install_end_message'] = 'La configuración de la aplicación correctamente se celebró, coloca en la etapa próxima<br><br>
  • trunk/language/es_ES/upgrade.lang.php

    r3282 r4280  
    3535$lang['upgrade login message'] = 'Sólo un administrador puede lanzar la puesta al día: por favor, identifiqúese más abajo.';
    3636$lang['You do not have access rights to run upgrade'] = 'Usted no tiene los derechos necessaires para lanzar la puesta al día.';
    37 /* TODO */$lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, before <b>?></b>, insert:';
     37/* TODO */$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In <i>include/config_database.inc.php</i>, before <b>?></b>, insert:';
    3838
    3939// Upgrade informations from upgrade_1.3.1.php
  • trunk/language/fr_FR/install.lang.php

    r3282 r4280  
    5555$lang['step2_pwd_conf'] = 'Mot de passe [ Confirmer ]';
    5656$lang['step2_pwd_conf_info'] = 'Vérification';
    57 $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é)';
     57$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é)';
    5858$lang['install_help'] = 'Besoin d\'aide ? Posez votre question sur le <a href="%s">forum de Piwigo</a>.';
    5959$lang['install_end_message'] = 'La configuration de l\'application s\'est correctement déroulée, place à la prochaine étape<br><br>
  • trunk/language/fr_FR/upgrade.lang.php

    r3282 r4280  
    3535$lang['upgrade login message'] = 'Seul un administrateur peut lancer la mise à jour: veuillez vous identifier ci-dessous.';
    3636$lang['You do not have access rights to run upgrade'] = 'Vous n\'avez pas les droits necessaires pour lancer la mise à jour.';
    37 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'Dans le fichier <i>include/mysql.inc.php</i>, avant <b>?></b>, insérez:';
     37$lang['in include/config_database.inc.php, before ?>, insert:'] = 'Dans le fichier <i>include/config_database.inc.php</i>, avant <b>?></b>, insérez:';
    3838
    3939// Upgrade informations from upgrade_1.3.1.php
  • trunk/language/it_IT/install.lang.php

    r3282 r4280  
    5555$lang['step2_pwd_conf'] = 'Password [confermare]';
    5656$lang['step2_pwd_conf_info'] = 'verifica';
    57 $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)';
     57$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)';
    5858$lang['install_help'] = 'Bisogno di un aiuto? Visitate il <a href="%s">forum di Piwigo</a>.';
    5959$lang['install_end_message'] = 'La configurazione di Piwigo è conclusa. Procedete al prossimo step<br><br>
  • trunk/language/it_IT/upgrade.lang.php

    r3565 r4280  
    3535$lang['upgrade login message'] = 'Solo un\'amministratore può eseguire l\'aggiornamento: identificatevi.';
    3636$lang['You do not have access rights to run upgrade'] = 'Non avete le autorizzazioni necessarie per effettuare l\'aggiornamento';
    37 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'Nel file <i>include/mysql.inc.php</i>, prima di <b>?></b>, inserire:';
     37$lang['in include/config_database.inc.php, before ?>, insert:'] = 'Nel file <i>include/config_database.inc.php</i>, prima di <b>?></b>, inserire:';
    3838
    3939// Upgrade informations from upgrade_1.3.1.php
  • trunk/language/nl_NL/install.lang.php

    r3282 r4280  
    3838$lang['step1_err_copy_2'] = 'Het is nu mogelijk om verder te gaan met de volgende stap van de installatie';
    3939$lang['step1_err_copy_next'] = 'volgende stap';
    40 $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';
     40$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';
    4141
    4242$lang['step1_host'] = 'MySQL host';
  • trunk/language/nl_NL/upgrade.lang.php

    r3282 r4280  
    3636$lang['upgrade login message'] = 'Only administrator can run upgrade: please sign in below.';
    3737$lang['You do not have access rights to run upgrade'] = 'You do not have access rights to run upgrade';
    38 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, before <b>?></b>, insert:';
     38$lang['in include/config_database.inc.php, before ?>, insert:'] = 'In <i>include/config_database.inc.php</i>, before <b>?></b>, insert:';
    3939
    4040// Upgrade informations from upgrade_1.3.1.php
  • trunk/language/pl_PL/install.lang.php

    r3282 r4280  
    3838$lang['step1_err_copy_2'] = 'Teraz mozliwy jest następny krok instalacji';
    3939$lang['step1_err_copy_next'] = 'następny krok';
    40 $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)';
     40$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)';
    4141
    4242$lang['step1_host'] = 'MySQL host';
  • trunk/language/pl_PL/upgrade.lang.php

    r3282 r4280  
    3535$lang['upgrade login message'] = 'Tylko administrator może wykonać aktualizację: zaloguj się poniżej.';
    3636$lang['You do not have access rights to run upgrade'] = 'Nie masz uprawnień do wykonania aktualizacji';
    37 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'W pliku <i>include/mysql.inc.php</i>, przed <b>?></b>, wstaw:';
     37$lang['in include/config_database.inc.php, before ?>, insert:'] = 'W pliku <i>include/config_database.inc.php</i>, przed <b>?></b>, wstaw:';
    3838
    3939// Upgrade informations from upgrade_1.3.1.php
  • trunk/tools/pwg_rel_create.sh

    r3282 r4280  
    3535# cvs export -r $tag -d $version phpwebgallery
    3636svn export http://piwigo.org/svn/tags/$tag $name
    37 # creating mysql.inc.php empty and writeable
    38 touch $name/include/mysql.inc.php
    39 chmod a+w $name/include/mysql.inc.php
     37# creating config_database.inc.php empty and writeable
     38touch $name/include/config_database.inc.php
     39chmod a+w $name/include/config_database.inc.php
    4040
    4141# find $name -name "*.php" \
  • 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          );
  • trunk/upgrade_feed.php

    r3282 r4280  
    3333include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    3434include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php');
    35 include(PHPWG_ROOT_PATH.'include/mysql.inc.php');
     35include(PHPWG_ROOT_PATH.'include/config_database.inc.php');
    3636include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
    3737@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
     
    5555// +-----------------------------------------------------------------------+
    5656
    57 mysql_connect($cfgHote, $cfgUser, $cfgPassword) or die("Could not connect to database server");
    58 mysql_select_db($cfgBase) or die("Could not connect to database");
     57mysql_connect($conf['db_host'], $conf['db_user'], $conf['db_password']) or die("Could not connect to database server");
     58mysql_select_db($conf['db_base']) or die("Could not connect to database");
    5959if ( version_compare(mysql_get_server_info(), '4.1.0', '>=')
    6060    and defined('DB_CHARSET') and DB_CHARSET!='' )
Note: See TracChangeset for help on using the changeset viewer.