diff --git a/bin/scheduler.php b/bin/scheduler.php
index a6e622c..c01a094 100644
--- a/bin/scheduler.php
+++ b/bin/scheduler.php
@@ -42,6 +42,15 @@ require_once(KT_LIB_DIR . '/database/dbutil.inc');
// Set the time limit to 0 to prevent the script timing out
set_time_limit(0);
+global $default;
+
+// Check the lock file before starting
+$lock = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock';
+if(file_exists($lock)){
+ $default->log->debug('Scheduler: can\'t start - lock file exists');
+ exit(0);
+}
+
/* ** Set up functions ** */
@@ -107,11 +116,8 @@ function getTaskList() {
return $result;
}
-
/* ** Scheduler script ** */
-global $default;
-
$default->log->debug('Scheduler: starting');
// Get task list
@@ -256,4 +262,4 @@ if (empty($aList))
$default->log->debug('Scheduler: stopping');
-?>
+?>
\ No newline at end of file
diff --git a/setup/upgrade.php b/setup/upgrade.php
index a55c100..0c36aeb 100644
--- a/setup/upgrade.php
+++ b/setup/upgrade.php
@@ -6,31 +6,31 @@
* Document Management Made Simple
* Copyright (C) 2008 KnowledgeTree Inc.
* Portions copyright The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
- * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
* California 94120-7775, or email info@knowledgetree.com.
- *
+ *
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
- *
+ *
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
- * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
- * must display the words "Powered by KnowledgeTree" and retain the original
+ * must display the words "Powered by KnowledgeTree" and retain the original
* copyright notice.
* Contributor( s): ______________________________________
*
@@ -120,24 +120,37 @@ function performAllUpgrades () {
break;
}
}
-
+
return $res;
}
function performPreUpgradeActions() {
-
+
// This is just to test and needs to be updated to a more sane and error resistent architrcture if it works.
// It should idealy work the same as the upgrades.
-
+
+ global $default;
+
+ // Lock the scheduler
+ $lockFile = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock';
+ touch($lockFile);
return true;
}
function performPostUpgradeActions() {
-
+
// This is just to test and needs to be updated to a more sane and error resistent architrcture if it works.
// It should idealy work the same as the upgrades.
-
+
+ global $default;
+
+ // Unlock the scheduler
+ $lockFile = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock';
+ if(file_exists($lockFile)){
+ unlink($lockFile);
+ }
+
// Clean out the plugin_helper table
$sql = "DELETE FROM plugin_helper";
$res = DBUtil::runQuery($sql);
@@ -184,7 +197,7 @@ td { vertical-align: top; }
- get('ui/mainLogo')){
echo $oKTConfig->get('ui/mainLogo');
}else{
@@ -219,31 +232,31 @@ switch ($action)
case 'Backup':
backup();
break;
- case 'BackupDone':
+ case 'BackupDone':
backupDone();
- break;
- case 'RestoreConfirm':
+ break;
+ case 'RestoreConfirm':
restoreConfirm();
- break;
- case 'RestoreSelect':
+ break;
+ case 'RestoreSelect':
restoreSelect();
- break;
- case 'RestoreSelected':
+ break;
+ case 'RestoreSelected':
restoreSelected();
- break;
- case 'Restore':
+ break;
+ case 'Restore':
restore();
- break;
- case 'RestoreDone':
+ break;
+ case 'RestoreDone':
restoreDone();
- break;
+ break;
case 'Login':
login();
break;
case 'LoginProcess':
loginProcess();
break;
- default:
+ default:
if (!isset($_SESSION['setup_user']))
login();
else
@@ -268,26 +281,26 @@ Only administrator users may access the upgrade wizard.
-We are about to start the upgrade process.
+We are about to start the upgrade process.
-
-
-
+
+
+
-
+
Are you sure you want to perform the backup?
-
+
Your mysql installation has been resolved. Manually, you would do the following:
@@ -537,7 +550,7 @@ Your mysql installation has been resolved. Manually, you would do the following:
cd ""
-
-
-
+
+
-
+
There don't seem to be any backups to restore from the "" directory.
@@ -618,22 +631,22 @@ function restoreSelect()
$i=0;
foreach($files as $file)
{
- $color=((($i++)%2)==0)?'white':'lightgrey';
+ $color=((($i++)%2)==0)?'white':'lightgrey';
?>
-
-
-
+
@@ -659,10 +672,10 @@ function restoreConfirm()
restoreSelect();
exit;
}
-
+
title('Confirm Restore');
$status = $_SESSION['backupStatus'];
- $filename=$_SESSION['backupFile'];
+ $filename=$_SESSION['backupFile'];
$stmt=create_restore_stmt($filename);
$dir=$stmt['dir'];
@@ -678,7 +691,7 @@ Manually, you would do the following to restore the backup:
cd ""
-continue to restore to attempt the command(s) above.
-
-
-
+
+
+
-
+
cd
-
-
+
It appears as though the backup process has failed. Unfortunately, it is difficult to diagnose these problems automatically
@@ -792,19 +805,19 @@ We appologise for the inconvenience.
-
-
-
+
+
+
-
-
-
+
+
- The restore of "" has been completed.
+ The restore of "" has been completed.
It appears as though the restore has been successful.
-
+
It appears as though the restore process has failed.