// standard
//$w->whereAdd('act_when > sent'); // eg.. sent is not valid..
- $w->whereAdd("sent < '1970-01-01'"); // eg.. sent is not valid..
+ $w->whereAdd("sent < '1970-01-01' OR sent IS NULL"); // eg.. sent is not valid..
$w->whereAdd('act_start > NOW() - INTERVAL 14 DAY'); // ignore the ones stuck in the queue
if (!$this->force) {
}
// phpinfo();exit;
- $tn = tempnam(ini_get('session.save_path'),'stdout') . '.stdout';
+ $tnx = tempnam(ini_get('session.save_path'),'stdout');
+ unlink($tnx);
+ $tn = $tnx . '.stdout';
$descriptorspec = array(
0 => array("pipe", 'r'), // stdin is a pipe that the child will read from
1 => array("file", $tn, 'w'), // stdout is a pipe that the child will write to
2 => array("pipe", "w") // stderr is a file to write to
);
- $php = $_SERVER["_"];
+
+ static $php = false;
+ if (!$php) {
+ require_once 'System.php';
+ $php = System::which('php');
+ }
+
$sn = $_SERVER["SCRIPT_NAME"];
$cwd = $sn[0] == '/' ? dirname($sn) : dirname(realpath(getcwd() . '/'. $sn)); // same as run on.. (so script should end up being same relatively..)