From c64da384ea354a194cfdcbd552340261b5d547d9 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 20 Apr 2006 19:31:12 +0000 Subject: partial merge -r1173:1174 from branch-1_6 to trunk: new configuration parameter die_on_sql_error (upgrade.php and install/upgrade_*.php not concerned on BSF) partial merge -r1208:1209 from branch-1_6 to trunk (only bug fix on incorrect insertion of complex upgrade identifiers) deletions: upgrade.php and all install/upgrade_*.php because these script are never up to date on BSF. Anyway, they are only required on a stable branch. git-svn-id: http://piwigo.org/svn/trunk@1221 68402e56-0260-453c-a942-63ccdbb3a9ee --- install.php | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index 8fe5b03ae..70d698147 100644 --- a/install.php +++ b/install.php @@ -166,6 +166,7 @@ include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); @include(PHPWG_ROOT_PATH. 'include/config_local.inc.php'); include(PHPWG_ROOT_PATH . 'include/constants.php'); include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); +include(PHPWG_ROOT_PATH . 'admin/include/functions.php'); include(PHPWG_ROOT_PATH . 'include/template.php'); if ( isset( $_POST['language'] )) @@ -332,16 +333,25 @@ INSERT INTO '.USER_INFOS_TABLE.' // Available upgrades must be ignored after a fresh installation. To // make PWG avoid upgrading, we must tell it upgrades have already been // made. + list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); + define('CURRENT_DATE', $dbnow); + $datas = array(); foreach (get_available_upgrade_ids() as $upgrade_id) { - $query = ' -INSERT INTO '.UPGRADE_TABLE.' - (id, applied, description) - VALUES - ('.$upgrade_id.', NOW(), \'upgrade included in installation\') -'; - mysql_query($query); + array_push( + $datas, + array( + 'id' => $upgrade_id, + 'applied' => CURRENT_DATE, + 'description' => 'upgrade included in installation', + ) + ); } + mass_inserts( + UPGRADE_TABLE, + array_keys($datas[0]), + $datas + ); } } -- cgit v1.2.3