Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
authorDan
Sat, 24 Nov 2007 01:35:12 -0500
changeset 289 2b60c89dc27f
parent 288 9a1a32bc2050
child 290 1201c9412cb6
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
ajax.php
includes/dbal.php
includes/sessions.php
upgrade.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') )
     {
--- 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');
     }
--- 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');
     }
--- 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') )