Changeset 830 for trunk/Modules/Notify/Notify.php
- Timestamp:
- Apr 30, 2016, 11:55:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Notify/Notify.php
r824 r830 6 6 { 7 7 var $Checks; 8 8 9 9 function __construct($System) 10 10 { … … 38 38 ), 39 39 )); 40 $this->System->RegisterCommandLine('notify', array($this, 'RunCheck')); 40 41 } 41 42 42 43 function RegisterCheck($Name, $Callback) 43 44 { 44 if(array_key_exists($Name, $this->Checks)) 45 if(array_key_exists($Name, $this->Checks)) 45 46 throw new Exception('Check function "'.$Name.'" already registered.'); 46 47 $this->Checks[$Name] = array('Callback' => $Callback); 47 48 } 48 49 49 50 function UnregisterCheck($Name) 50 51 { 51 if(!array_key_exists($Name, $this->Checks)) 52 if(!array_key_exists($Name, $this->Checks)) 52 53 throw new Exception('Check function "'.$Name.'" not registered.'); 53 54 unset($this->Checks[$Name]); … … 104 105 } 105 106 107 function RunCheck($Parameters) 108 { 109 RepeatFunction(30, array($this, 'Check')); 110 } 111 106 112 function DoInstall() 107 113 { … … 142 148 } 143 149 } 144 145 class ScheduleNotifyCheck extends SchedulerTask146 {147 function Execute()148 {149 $Output = $this->System->ModuleManager->Modules['Notify']->Check();150 151 return($Output);152 }153 }
Note:
See TracChangeset
for help on using the changeset viewer.