0f79f71f91737f5fb3210a5c6fc0281b0cdf248a
[Pman.Core] / NotifySend.php
1 <?php
2 require_once 'Pman.php';
3
4 /**
5  * notification script runner
6  *
7  * This does not actualy send stuf out, it only starts the NotifySend/{id}
8  * which does the actuall notifcations.
9  *
10  * It manages a pool of notifiers.
11  * 
12  * 
13  */
14
15
16 class Pman_Core_NotifySend extends Pman
17 {
18     
19     var $table = 'core_notify'
20     function getAuth()
21     {
22         $ff = HTML_FlexyFramework::get();
23         if (!$ff->cli) {
24             die("access denied");
25         }
26         //HTML_FlexyFramework::ensureSingle(__FILE__, $this);
27         return true;
28         
29     }
30     
31     var $pool = array();
32     
33     function get($id)    
34     {
35         DB_DataObject::debugLevel(1);
36         //date_default_timezone_set('UTC');
37         // phpinfo();exit;
38         
39         $w = DB_DataObject::factory($this->table);
40         
41         if (!$w->get($id) || strtotime($w->act_when) < strtotime($w->sent)) {
42             die("invalid id or time");
43         }
44          
45         $o = $w->object();
46         $p = $w->person();
47         
48         $email = $o->toEmail($p,)
49         // should we fetch the watch that caused it.. - which should contain the method to call..
50          
51          
52         die("DONE\n");
53     }
54      
55     
56     
57 }