|
From: Markus P. <mar...@us...> - 2005-03-26 02:48:20
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2226 Modified Files: mx_install.php Log Message: Fixed Global Variables initialization (that piece related to phpBB common.php was not really up to date). Added code to update cache, only if an upgrade processed one or more SQL schemas. Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mx_install.php 23 Mar 2005 22:20:00 -0000 1.37 --- mx_install.php 26 Mar 2005 02:48:04 -0000 1.38 *************** *** 54,58 **** // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.6'); define('INSTALLER_NAME', 'mxBB-Installer'); --- 54,58 ---- // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.7'); define('INSTALLER_NAME', 'mxBB-Installer'); *************** *** 80,92 **** // common.php from phpBB 2.0.13 // - function unset_vars( &$var ) - { - while ( list( $var_name, $null ) = @each( $var ) ) - { - unset( $GLOBALS[$var_name] ); - } - return; - } - error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime --- 80,83 ---- *************** *** 117,121 **** // We 'flip' the array of variables to test like this so that // we can validate later with isset($test[$var]) (no in_array()) ! $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL); // Loop through each input array --- 108,112 ---- // We 'flip' the array of variables to test like this so that // we can validate later with isset($test[$var]) (no in_array()) ! $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL); // Loop through each input array *************** *** 136,140 **** { // PHP4+ path ! // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if --- 127,132 ---- { // PHP4+ path ! $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); ! // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if *************** *** 150,159 **** unset($input['input']); ! while (list($var,) = @each($input)) { ! unset($$var); } ! unset($input); } --- 142,155 ---- unset($input['input']); ! unset($input['not_unset']); ! while (list($var,) = @each($input)) { ! if (!in_array($var, $not_unset)) ! { ! unset($$var); ! } } ! unset($input); } *************** *** 254,264 **** 'COMMENTS' => 'remove_remarks' ), ! // 'postgres' => array( ! // 'LABEL' => 'PostgreSQL 7.x', ! // 'SCHEMA' => 'postgres', ! // 'DELIM' => ';', ! // 'DELIM_BASIC' => ';', ! // 'COMMENTS' => 'remove_comments' ! // ), // 'mssql' => array( // 'LABEL' => 'MS SQL Server 7/2000', --- 250,260 ---- 'COMMENTS' => 'remove_remarks' ), ! 'postgres' => array( ! 'LABEL' => 'PostgreSQL 7.x', ! 'SCHEMA' => 'postgres', ! 'DELIM' => ';', ! 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'remove_comments' ! ), // 'mssql' => array( // 'LABEL' => 'MS SQL Server 7/2000', *************** *** 563,566 **** --- 559,583 ---- exec_post_process($install_mode); + // + // Update cache? Only if it's an upgrade and we really processed one or more schemas. + // + if( $install_mode == 'upgrade' && count($schemas) > 0 ) + { + // + // FYI: update_session_cache() needs $portal_config to be filled. + // + $sql = 'SELECT * FROM '.PORTAL_TABLE.' WHERE portal_id = 1'; + if( ($result = $db->sql_query($sql)) ) + { + $portal_config = $db->sql_fetchrow($result); + include($mx_root_path . "includes/mx_cache.$phpEx"); + update_session_cache(); + $process_msgs[] = $lang['Cache_generate']; + } + } + + // + // Generate processing report and bye. + // $message = '<hr />'; for( $i=0; $i < count($process_msgs); $i++ ) *************** *** 1221,1225 **** { $fullname = $tmpary[$i] . '/' . $phpbb_files[$j]; ! if( !is_file($fullname) ) { $is_phpbb_dir = false; --- 1238,1242 ---- { $fullname = $tmpary[$i] . '/' . $phpbb_files[$j]; ! if( !@is_file($fullname) ) { $is_phpbb_dir = false; |