diff options
author | patdenice <patdenice@piwigo.org> | 2010-03-26 16:49:23 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2010-03-26 16:49:23 +0000 |
commit | 7b25308e7392a028dc7573d6593e398748534b1a (patch) | |
tree | 8025734ab4d72c403dba275c9c742eacad2ac224 /upgrade.php | |
parent | b9978b0ad3e1eee137e5c051834ee9f0dde0ace0 (diff) |
Fix php5 apache configuration with upgrade.
git-svn-id: http://piwigo.org/svn/trunk@5387 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'upgrade.php')
-rw-r--r-- | upgrade.php | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/upgrade.php b/upgrade.php index 9bb6add8b..fb7bc15e7 100644 --- a/upgrade.php +++ b/upgrade.php @@ -38,31 +38,16 @@ if ($php_end_tag === false) 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.'local/config/database.inc.php'); include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); @include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); -include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); - -prepare_conf_upgrade(); +// $conf is not used for users tables - define cannot be re-defined +define('USERS_TABLE', $prefixeTable.'users'); include_once(PHPWG_ROOT_PATH.'include/constants.php'); define('PREFIX_TABLE', $prefixeTable); -// Database connection -try -{ - $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'], - $conf['db_password'], $conf['db_base']); -} -catch (Exception $e) -{ - my_error(l10n($e->getMessage(), true)); -} - -pwg_db_check_charset(); - // +-----------------------------------------------------------------------+ // | functions | // +-----------------------------------------------------------------------+ @@ -148,6 +133,9 @@ function print_time($message) // +-----------------------------------------------------------------------+ // | language | // +-----------------------------------------------------------------------+ +include(PHPWG_ROOT_PATH . 'admin/include/languages.class.php'); +$languages = new languages('utf-8'); + if (isset($_GET['language'])) { $language = strip_tags($_GET['language']); @@ -156,7 +144,7 @@ else { $language = 'en_UK'; // Try to get browser language - foreach (get_languages('utf-8') as $language_code => $language_name) + foreach ($languages->fs_languages as $language_code => $language_name) { if (substr($language_code,0,2) == @substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)) { @@ -207,6 +195,16 @@ if (version_compare(PHP_VERSION, REQUIRED_PHP_VERSION, '<')) } // +-----------------------------------------------------------------------+ +// | database connection | +// +-----------------------------------------------------------------------+ +include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); +include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); + +upgrade_db_connect(); + +pwg_db_check_charset(); + +// +-----------------------------------------------------------------------+ // | template initialization | // +-----------------------------------------------------------------------+ |