Update of /cvsroot/basedb/basedb/include/classes
In directory sc8-pr-cvs1:/tmp/cvs-serv9956/include/classes
Modified Files:
basecontrol.inc.php ftpd.inc.php jobhandler.inc.php
Log Message:
rewrote BaseControl to be much more robust and optionally use flock()
Index: basecontrol.inc.php
===================================================================
RCS file: /cvsroot/basedb/basedb/include/classes/basecontrol.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** basecontrol.inc.php 15 Feb 2003 11:31:41 -0000 1.10
--- basecontrol.inc.php 16 Feb 2003 02:03:47 -0000 1.11
***************
*** 40,44 ****
class BaseControl
{
! var $depth, $iua;
function BaseControl()
--- 40,44 ----
class BaseControl
{
! var $depth, $iua, $fd;
[...389 lines suppressed...]
}
! // Let BASE get back online. Call this function only after a successful
! // startScript(true).
function endShutdown()
{
if(!$this->abortShutdown(false))
return false;
$query = "UPDATE BaseControl SET `startTime` = NOW()";
return (bool)query($query);
+ }
+
+ // Returns an array with shutDown, pendingTransactions, etc.
+ function getState()
+ {
+ $query = "SELECT * FROM BaseControl";
+ $res = query($query);
+ return db_fetch_assoc($res);
}
Index: ftpd.inc.php
===================================================================
RCS file: /cvsroot/basedb/basedb/include/classes/ftpd.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ftpd.inc.php 10 Feb 2003 08:40:44 -0000 1.3
--- ftpd.inc.php 16 Feb 2003 02:03:48 -0000 1.4
***************
*** 73,83 ****
function dispatch($line)
{
- global $BC;
- if(!$BC->mayRun())
- {
- echo "421 BASE is shutting down";
- exit;
- }
-
$arr = explode(" ", $line, 2);
$cmd = strtoupper($arr[0]);
--- 73,76 ----
Index: jobhandler.inc.php
===================================================================
RCS file: /cvsroot/basedb/basedb/include/classes/jobhandler.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** jobhandler.inc.php 11 Feb 2003 14:43:10 -0000 1.10
--- jobhandler.inc.php 16 Feb 2003 02:03:48 -0000 1.11
***************
*** 126,131 ****
$prog =& $this->prog;
! // Let go or transaction while the job's running.
$BC->endTransaction();
list($u, $s) = explode(" ", microtime());
--- 126,132 ----
$prog =& $this->prog;
! // Let go of everything while the job's running.
$BC->endTransaction();
+ $BC->endScript();
list($u, $s) = explode(" ", microtime());
|