Changeset 800 for trunk/includes/AppModule.php
- Timestamp:
- Mar 16, 2014, 11:15:43 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/AppModule.php
r545 r800 6 6 var $Name; 7 7 var $Version; 8 var $License; 8 var $License; 9 9 var $Creator; 10 10 var $Description; … … 19 19 var $Manager; 20 20 var $OnChange; 21 21 22 22 function __construct($System) 23 23 { … … 27 27 $this->Dependencies = array(); 28 28 } 29 29 30 30 function Install() 31 31 { 32 32 } 33 33 34 34 function Uninstall() 35 35 { 36 36 } 37 37 38 38 function Start() 39 39 { 40 40 } 41 41 42 42 function Stop() 43 43 { 44 } 44 } 45 45 } 46 46 47 class AppModuleManager 47 class AppModuleManager 48 48 { 49 49 var $Modules; 50 50 51 51 function __construct() 52 52 { 53 $this->Modules = array(); 53 $this->Modules = array(); 54 54 } 55 55 56 56 function StartAll() 57 57 { … … 71 71 } 72 72 } 73 73 74 74 function ModulePresent($Name) 75 75 { 76 76 return(array_key_exists($Name, $this->Modules)); 77 77 } 78 78 79 79 function RegisterModule(AppModule $Module) 80 80 { 81 $this->Modules[$Module->Name] = &$Module; 82 $Module->Manager = &$this; 83 $Module->OnChange = &$this->OnModuleChange; 81 if(!isset($this->Modules[$Module->Name])) 82 { 83 $this->Modules[$Module->Name] = &$Module; 84 $Module->Manager = &$this; 85 $Module->OnChange = &$this->OnModuleChange; 86 } else throw new Exception('Module '.$Module->Name.' redefined'); 84 87 } 85 88 86 89 function UnregisterModule($Module) 87 90 { 88 unset($this->Modules[array_search($Module, $this->Modules)]); 91 unset($this->Modules[array_search($Module, $this->Modules)]); 89 92 } 90 93 91 94 /* @return Module */ 92 95 function SearchModuleById($Id) … … 98 101 } 99 102 return(''); 100 } 103 } 101 104 }
Note:
See TracChangeset
for help on using the changeset viewer.