Changeset 5387
- Timestamp:
- Mar 26, 2010, 5:49:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_install.inc.php
r5384 r5387 140 140 } 141 141 142 function try_db_connection(&$infos, &$errors)142 function install_db_connect(&$infos, &$errors) 143 143 { 144 144 try -
trunk/admin/include/functions_upgrade.php
r5196 r5387 67 67 define('PLUGINS_TABLE', $prefixeTable.'plugins'); 68 68 define('OLD_PERMALINKS_TABLE', $prefixeTable.'old_permalinks'); 69 define('THEMES_TABLE', $prefixeTable.'themes'); 70 define('LANGUAGES_TABLE', $prefixeTable.'languages'); 69 71 } 70 72 … … 214 216 } 215 217 218 function upgrade_db_connect() 219 { 220 global $conf; 221 222 try 223 { 224 $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'], 225 $conf['db_password'], $conf['db_base']); 226 } 227 catch (Exception $e) 228 { 229 my_error(l10n($e->getMessage()), true); 230 } 231 } 232 216 233 ?> -
trunk/install.php
r5384 r5387 184 184 include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); 185 185 include(PHPWG_ROOT_PATH . 'admin/include/functions.php'); 186 include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php');187 186 188 187 include(PHPWG_ROOT_PATH . 'admin/include/languages.class.php'); … … 260 259 include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$dblayer.'.inc.php'); 261 260 include(PHPWG_ROOT_PATH . 'admin/include/functions_install.inc.php'); 261 include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php'); 262 262 263 263 if ( isset( $_POST['install'] )) 264 264 { 265 if ( try_db_connection($infos, $errors))265 if (install_db_connect($infos, $errors)) 266 266 { 267 267 $required_version = constant('REQUIRED_'.strtoupper($dblayer).'_VERSION'); -
trunk/upgrade.php
r5238 r5387 39 39 include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); 40 40 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 41 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php');42 41 43 42 include(PHPWG_ROOT_PATH.'local/config/database.inc.php'); 44 43 include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); 45 44 @include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); 46 include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); 47 48 prepare_conf_upgrade(); 49 45 46 // $conf is not used for users tables - define cannot be re-defined 47 define('USERS_TABLE', $prefixeTable.'users'); 50 48 include_once(PHPWG_ROOT_PATH.'include/constants.php'); 51 49 define('PREFIX_TABLE', $prefixeTable); 52 53 // Database connection54 try55 {56 $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],57 $conf['db_password'], $conf['db_base']);58 }59 catch (Exception $e)60 {61 my_error(l10n($e->getMessage(), true));62 }63 64 pwg_db_check_charset();65 50 66 51 // +-----------------------------------------------------------------------+ … … 149 134 // | language | 150 135 // +-----------------------------------------------------------------------+ 136 include(PHPWG_ROOT_PATH . 'admin/include/languages.class.php'); 137 $languages = new languages('utf-8'); 138 151 139 if (isset($_GET['language'])) 152 140 { … … 157 145 $language = 'en_UK'; 158 146 // Try to get browser language 159 foreach ( get_languages('utf-8')as $language_code => $language_name)147 foreach ($languages->fs_languages as $language_code => $language_name) 160 148 { 161 149 if (substr($language_code,0,2) == @substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)) … … 206 194 include(PHPWG_ROOT_PATH.'install/php5_apache_configuration.php'); 207 195 } 196 197 // +-----------------------------------------------------------------------+ 198 // | database connection | 199 // +-----------------------------------------------------------------------+ 200 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); 201 include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); 202 203 upgrade_db_connect(); 204 205 pwg_db_check_charset(); 208 206 209 207 // +-----------------------------------------------------------------------+
Note: See TracChangeset
for help on using the changeset viewer.