[Jaws-commits] r13367 - branches/0.8/html/upgrade/stages

afz at jaws-project.com afz at jaws-project.com
Fri Aug 10 15:57:16 UTC 2012


Author: afz
Date: 2012-08-10 15:57:16 +0000 (Fri, 10 Aug 2012)
New Revision: 13367

Modified:
   branches/0.8/html/upgrade/stages/0817To0818.php
Log:
upgrading to 0.8.18 ready

Modified: branches/0.8/html/upgrade/stages/0817To0818.php
===================================================================
--- branches/0.8/html/upgrade/stages/0817To0818.php	2012-08-10 15:28:40 UTC (rev 13366)
+++ branches/0.8/html/upgrade/stages/0817To0818.php	2012-08-10 15:57:16 UTC (rev 13367)
@@ -47,6 +47,33 @@
             return new Jaws_Error(_t('UPGRADE_DB_RESPONSE_CONNECT_FAILED'), 0, JAWS_ERROR_WARNING);
         }
 
+        _log(JAWS_LOG_DEBUG,"delete all record of session table");
+        $sql = 'DELETE FROM [[session]]';
+        $res = $GLOBALS['db']->query($sql);
+        if (Jaws_Error::IsError($res)) {
+            return $res;
+        }
+
+        // upgrade core database schema
+        $old_schema = JAWS_PATH . 'upgrade/schema/0.8.16.xml';
+        $new_schema = JAWS_PATH . 'upgrade/schema/schema.xml';
+        if (!file_exists($old_schema)) {
+            return new Jaws_Error(_t('GLOBAL_ERROR_SQLFILE_NOT_EXISTS', '0.8.16.xml'),0 , JAWS_ERROR_ERROR);
+        }
+
+        if (!file_exists($new_schema)) {
+            return new Jaws_Error(_t('GLOBAL_ERROR_SQLFILE_NOT_EXISTS', 'schema.xml'),0 , JAWS_ERROR_ERROR);
+        }
+
+        _log(JAWS_LOG_DEBUG,"Upgrading core schema");
+        $result = $GLOBALS['db']->installSchema($new_schema, '', $old_schema);
+        if (Jaws_Error::isError($result)) {
+            _log(JAWS_LOG_WARNING, $result->getMessage());
+            if ($result->getCode() !== MDB2_ERROR_ALREADY_EXISTS) {
+                return new Jaws_Error($result->getMessage(), 0, JAWS_ERROR_ERROR);
+            }
+        }
+
         // Create application
         include_once JAWS_PATH . 'include/Jaws.php';
         $GLOBALS['app'] = new Jaws();



More information about the Jaws-commits mailing list