Changeset 5387


Ignore:
Timestamp:
03/26/10 17:49:23 (10 years ago)
Author:
patdenice
Message:

Fix php5 apache configuration with upgrade.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_install.inc.php

    r5384 r5387  
    140140} 
    141141 
    142 function try_db_connection(&$infos, &$errors) 
     142function install_db_connect(&$infos, &$errors) 
    143143{ 
    144144  try 
  • trunk/admin/include/functions_upgrade.php

    r5196 r5387  
    6767  define('PLUGINS_TABLE', $prefixeTable.'plugins'); 
    6868  define('OLD_PERMALINKS_TABLE', $prefixeTable.'old_permalinks'); 
     69  define('THEMES_TABLE', $prefixeTable.'themes'); 
     70  define('LANGUAGES_TABLE', $prefixeTable.'languages'); 
    6971} 
    7072 
     
    214216} 
    215217 
     218function 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 
    216233?> 
  • trunk/install.php

    r5384 r5387  
    184184include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); 
    185185include(PHPWG_ROOT_PATH . 'admin/include/functions.php'); 
    186 include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php'); 
    187186 
    188187include(PHPWG_ROOT_PATH . 'admin/include/languages.class.php'); 
     
    260259include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$dblayer.'.inc.php'); 
    261260include(PHPWG_ROOT_PATH . 'admin/include/functions_install.inc.php'); 
     261include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php'); 
    262262 
    263263if ( isset( $_POST['install'] )) 
    264264{ 
    265   if (try_db_connection($infos, $errors)) 
     265  if (install_db_connect($infos, $errors)) 
    266266  { 
    267267    $required_version = constant('REQUIRED_'.strtoupper($dblayer).'_VERSION'); 
  • trunk/upgrade.php

    r5238 r5387  
    3939include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); 
    4040include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    41 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); 
    4241 
    4342include(PHPWG_ROOT_PATH.'local/config/database.inc.php'); 
    4443include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); 
    4544@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 
     47define('USERS_TABLE', $prefixeTable.'users'); 
    5048include_once(PHPWG_ROOT_PATH.'include/constants.php'); 
    5149define('PREFIX_TABLE', $prefixeTable); 
    52  
    53 // Database connection 
    54 try 
    55 { 
    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(); 
    6550 
    6651// +-----------------------------------------------------------------------+ 
     
    149134// |                             language                                  | 
    150135// +-----------------------------------------------------------------------+ 
     136include(PHPWG_ROOT_PATH . 'admin/include/languages.class.php'); 
     137$languages = new languages('utf-8'); 
     138 
    151139if (isset($_GET['language'])) 
    152140{ 
     
    157145  $language = 'en_UK'; 
    158146  // 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) 
    160148  { 
    161149    if (substr($language_code,0,2) == @substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)) 
     
    206194  include(PHPWG_ROOT_PATH.'install/php5_apache_configuration.php'); 
    207195} 
     196 
     197// +-----------------------------------------------------------------------+ 
     198// |                          database connection                          | 
     199// +-----------------------------------------------------------------------+ 
     200include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); 
     201include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); 
     202 
     203upgrade_db_connect(); 
     204 
     205pwg_db_check_charset(); 
    208206 
    209207// +-----------------------------------------------------------------------+ 
Note: See TracChangeset for help on using the changeset viewer.