Notify.php
[Pman.Core] / Notify.php
index 418fc2a..902b7a4 100644 (file)
@@ -158,7 +158,7 @@ class Pman_Core_Notify extends Pman
             
         }
      
-        //DB_DataObject::debugLevel(1);
+        DB_DataObject::debugLevel(1);
         $w = DB_DataObject::factory($this->table);
         
         if (!$showold) {
@@ -280,13 +280,21 @@ class Pman_Core_Notify extends Pman
         }
         
         // 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 = $_ENV["_"];
+        
+        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..)