Changeset 469 for trunk/Common/AppModule.php
- Timestamp:
- Dec 30, 2012, 9:13:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/AppModule.php
r467 r469 18 18 /** @var ModularSystem */ 19 19 var $Manager; 20 var $OnChange; 20 21 21 function __construct($ Database, $System)22 function __construct($System) 22 23 { 23 24 $this->System = &$System; 24 $this->Database = &$ Database;25 $this->Database = &$System->Database; 25 26 } 26 27 … … 39 40 function Stop() 40 41 { 42 } 43 } 44 45 class AppModuleManager 46 { 47 var $Modules; 48 49 function __construct() 50 { 51 $this->Modules = array(); 41 52 } 42 53 54 function StartAll() 55 { 56 foreach($this->Modules as $Index => $Module) 57 { 58 //DebugLog('Init module '.$Module->Name); 59 $this->Modules[$Index]->Start(); 60 } 61 } 62 63 function StopAll() 64 { 65 foreach($this->Modules as $Index => $Module) 66 { 67 //DebugLog('Init module '.$Module->Name); 68 $this->Modules[$Index]->Stop(); 69 } 70 } 71 72 function ModulePresent($Name) 73 { 74 return(array_key_exists($Name, $this->Modules)); 75 } 76 77 function RegisterModule(AppModule $Module) 78 { 79 $this->Modules[$Module->Name] = &$Module; 80 $Module->Manager = &$this; 81 $Module->OnChange = &$this->OnModuleChange; 82 } 83 84 function UnregisterModule($Module) 85 { 86 unset($this->Modules[array_search($Module, $this->Modules)]); 87 } 43 88 } 44 89
Note:
See TracChangeset
for help on using the changeset viewer.