Changeset 425 for branches/Modular/Common/Module.php
- Timestamp:
- Oct 10, 2012, 12:21:38 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Modular/Common/Module.php
r424 r425 18 18 var $Installed; 19 19 var $Running; 20 var $System; 20 21 /** @var ModularSystem */ 21 var $M odularSystem;22 var $Manager; 22 23 23 24 … … 38 39 // Install dependencies first 39 40 foreach($this->Dependencies as $Dependency) 40 $this->M odularSystem->Modules[$Dependency]->Install();41 $this->Manager->Modules[$Dependency]->Install(); 41 42 $this->DoChange(); 42 43 } … … 68 69 $this->Running = true; 69 70 foreach($this->Dependencies as $Dependency) 70 $this-> System->Modules[$Dependency]->Start();71 $this->Manager->Modules[$Dependency]->Start(); 71 72 $this->LoadModels(); 72 73 $this->DoChange(); … … 86 87 private function DoChange() 87 88 { 88 if($this->M odularSystem->OnModuleChange)89 call_user_func_array($this->M odularSystem->OnModuleChange, array($this));89 if($this->Manager->OnModuleChange) 90 call_user_func_array($this->Manager->OnModuleChange, array($this)); 90 91 } 91 92 … … 102 103 function LoadModels() 103 104 { 105 //echo($this->Name.'... '); 104 106 $this->Models = array(); 105 107 foreach($this->SupportedModels as $ModelName) … … 108 110 $NewModel->Module = &$this; 109 111 $this->Models[$ModelName] = $NewModel; 112 //DebugLog($ModelName.'.LoadModels()'); 110 113 } 111 114 } … … 136 139 } 137 140 141 function StartInstalled() 142 { 143 foreach($this->Modules as $Index => $Module) 144 { 145 //DebugLog('Init module '.$Module->Name); 146 if($Module->IsInstalled()) $this->Modules[$Index]->Start(); 147 } 148 } 149 138 150 function StopAll() 139 151 { … … 187 199 { 188 200 $this->Modules[$Module->Name] = &$Module; 189 $Module->M odularSystem =$this;201 $Module->Manager = &$this; 190 202 $Module->OnChange = &$this->OnModuleChange; 191 203 } … … 224 236 if(array_key_exists($Module->Name, $ModulesOnDisk)) 225 237 { 226 $this->M odularSystem->UnregisterModule($Module);238 $this->Manager->UnregisterModule($Module); 227 239 } 228 240 }
Note:
See TracChangeset
for help on using the changeset viewer.