Ticket #132: engine_patch.patch
| File engine_patch.patch, 1.7 KB (added by ort, 22 months ago) |
|---|
-
classes/Engine.class.php
121 121 $oProfiler=ProfilerSimple::getInstance(); 122 122 $iTimeId=$oProfiler->Start('InitModule',get_class($oModule)); 123 123 124 $oModule->Init(); 125 $oModule->SetInit(); 124 $this->InitModule($oModule); 126 125 127 126 $oProfiler->Stop($iTimeId); 128 127 } 129 128 } 130 129 } 131 130 131 protected function InitModule($oModule){ 132 $sOrigClassName = $sClassName = get_class($oModule); 133 $bRunHooks = false; 134 135 $aModuleHook = $this->GetModule('Hook_x'); 136 if($aModuleHook[0]->isInit()){ 137 $bRunHooks = true; 138 while(preg_match('#^Plugin#i', $sClassName)){ 139 $sParentClassName = get_parent_class($sClassName); 140 if($sParentClassName == 'Module'){ 141 break; 142 } 143 $sClassName = $sParentClassName; 144 } 145 } 146 147 if($bRunHooks){ 148 $this->Hook_Run('module_init_'.$sClassName.'_before'); 149 } 150 $oModule->Init(); 151 $oModule->SetInit(); 152 if($bRunHooks || $sClassName == 'ModuleHook'){ 153 $this->Hook_Run('module_init_'.$sClassName.'_after'); 154 } 155 } 156 132 157 /** 133 158 * Завершаем работу всех модулей 134 159 * … … 160 185 * Создаем объект модуля 161 186 */ 162 187 $oModule=new $sModuleName($this); 163 if ($bInit or $sModuleName=='Cache') {164 $oModule->Init();165 $oModule->SetInit();166 }167 188 $this->aModules[$sModuleName]=$oModule; 189 if ($bInit or $sModuleName=='ModuleCache') { 190 $this->InitModule($oModule); 191 } 168 192 $tm2=microtime(true); 169 193 $this->iTimeLoadModule+=$tm2-$tm1; 170 194 dump("load $sModuleName - \t\t".($tm2-$tm1)."");
