DataObjects/Core_notify_recur.php
[Pman.Core] / Notify.php
index ab11fdb..94f6752 100644 (file)
@@ -43,7 +43,7 @@ class Pman_Core_Notify extends Pman
             'max' => 0,
             
         ),
-         'force' => array(
+        'force' => array(
             'desc' => 'Force redelivery, even if it has been sent before or not queued...',
             'default' => 0,
             'short' => 'f',
@@ -91,6 +91,13 @@ class Pman_Core_Notify extends Pman
             $this->send_to = $opts['send-to'];
         }
      
+        
+        $w = DB_DataObject::factory('core_notify_recur');
+        if (is_a($w, 'DB_DataObject')) {
+            $w->generateNotifications();
+        }
+     
+     
         //DB_DataObject::debugLevel(1);
         $w = DB_DataObject::factory($this->table);
         
@@ -176,7 +183,7 @@ class Pman_Core_Notify extends Pman
         die("DONE\n");
     }
     
-    function run($id, $email)
+    function run($id, $email, $cmdOpts="")
     {
        // phpinfo();exit;
         $tn = tempnam(ini_get('session.save_path'),'stdout') . '.stdout';
@@ -196,7 +203,7 @@ class Pman_Core_Notify extends Pman
         if (!empty($this->send_to)) {
             $app .= ' --sent-to='.escapeshellarg($this->send_to);
         }
-        $cmd = $php . ' ' . $app; //. ' &';
+        $cmd = $php . ' ' . $app . ' ' . $cmdOpts; //. ' &';
         
        
         $pipe = array();