# HG changeset patch # User Dan # Date 1195886112 18000 # Node ID 2b60c89dc27f95f0ee2aa46cb7c218a03055b982 # Parent 9a1a32bc2050200f8dc4ecbb8a730ef3c77ca528 Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL diff -r 9a1a32bc2050 -r 2b60c89dc27f ajax.php --- a/ajax.php Sat Nov 24 01:04:30 2007 -0500 +++ b/ajax.php Sat Nov 24 01:35:12 2007 -0500 @@ -21,6 +21,11 @@ function dc_watch($n) { return false; } function dc_start_timer($u) { return false; } function dc_stop_timer($m) { return false; } + function microtime_float() + { + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); + } // Determine directory (special case for development servers) if ( strpos(__FILE__, '/repo/') && file_exists('.enanodev') ) { diff -r 9a1a32bc2050 -r 2b60c89dc27f includes/dbal.php --- a/includes/dbal.php Sat Nov 24 01:04:30 2007 -0500 +++ b/includes/dbal.php Sat Nov 24 01:35:12 2007 -0500 @@ -126,7 +126,7 @@ dc_here('dbal: trying to connect....'); - if ( defined('IN_ENANO_INSTALL') ) + if ( defined('IN_ENANO_INSTALL') && !defined('IN_ENANO_UPGRADE') ) { @include(ENANO_ROOT.'/config.new.php'); } diff -r 9a1a32bc2050 -r 2b60c89dc27f includes/sessions.php --- a/includes/sessions.php Sat Nov 24 01:04:30 2007 -0500 +++ b/includes/sessions.php Sat Nov 24 01:35:12 2007 -0500 @@ -260,7 +260,7 @@ { global $db, $session, $paths, $template, $plugins; // Common objects - if ( defined('IN_ENANO_INSTALL') ) + if ( defined('IN_ENANO_INSTALL') && !defined('IN_ENANO_UPGRADE') ) { @include(ENANO_ROOT.'/config.new.php'); } diff -r 9a1a32bc2050 -r 2b60c89dc27f upgrade.php --- a/upgrade.php Sat Nov 24 01:04:30 2007 -0500 +++ b/upgrade.php Sat Nov 24 01:35:12 2007 -0500 @@ -13,7 +13,8 @@ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. */ -define('IN_ENANO_INSTALL', 'true'); +define('IN_ENANO_INSTALL', 'true'); +define('IN_ENANO_UPGRADE', 'true'); if(!defined('scriptPath')) { $sp = dirname($_SERVER['REQUEST_URI']); @@ -27,8 +28,16 @@ define('contentPath', $sp); } -global $_starttime, $this_page, $sideinfo; -$_starttime = microtime(true); +global $this_page, $sideinfo; + +function microtime_float() +{ + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); +} + +global $_starttime; +$_starttime = microtime_float(); // Determine directory (special case for development servers) if ( strpos(__FILE__, '/repo/') && file_exists('.enanodev') )