1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

Исключено использование модуля Lang в модулях автозагрузки.

This commit is contained in:
Alexey Kachayev 2009-11-22 18:59:19 +00:00
parent 617ca93e4e
commit 0aefe445e2
4 changed files with 16 additions and 24 deletions

View file

@ -57,7 +57,7 @@ class Init {
*/
public function InitAction() {
if (!$this->oUserCurrent and Config::Get('general.close') and Router::GetAction()!='registration' and Router::GetAction()!='login') {
Router::Action('login');
Router::Action('login');
}
$this->Hook_Run('init_action');
}

View file

@ -102,7 +102,7 @@ class Engine extends Object {
*
*/
protected function ShutdownModules() {
foreach ($this->aModules as $sKey => $oModule) {
foreach ($this->aModules as $sKey => $oModule) {
$oModule->Shutdown();
}
}
@ -114,7 +114,7 @@ class Engine extends Object {
* @return unknown
*/
protected function LoadModule($sModuleName,$bInit=false) {
$tm1=microtime(true);
$tm1=microtime(true);
if ($this->isFileExists(Config::Get('path.root.engine')."/modules/".strtolower($sModuleName)."/".$sModuleName.".class.php")) {
require_once(Config::Get('path.root.engine')."/modules/".strtolower($sModuleName)."/".$sModuleName.".class.php");
} elseif ($this->isFileExists(Config::Get('path.root.server')."/classes/modules/".strtolower($sModuleName)."/".$sModuleName.".class.php")) {
@ -176,7 +176,7 @@ class Engine extends Object {
$sClassName='Hook'.$aMatch[1];
$oHook=new $sClassName;
$oHook->RegisterHook();
}
}
}
}
closedir($hDir);
@ -230,7 +230,7 @@ class Engine extends Object {
}
$sCmd='$result=$oModule->'.$aName[1].'('.$sArgs.');';
$oProfiler=ProfilerSimple::getInstance();
$iTimeId=$oProfiler->Start('callModule',$sModuleName.'->'.$aName[1].'()');
$iTimeId=$oProfiler->Start('callModule',$sModuleName.'->'.$aName[1].'()');
eval($sCmd);
$oProfiler->Stop($iTimeId);
return $result;

View file

@ -76,14 +76,12 @@ class LsCache extends Module {
$this->oBackendCache = new Dklab_Cache_Backend_Profiler($oCahe,array($this,'CalcStats'));
} elseif ($this->sCacheType==SYS_CACHE_TYPE_MEMORY) {
require_once('Zend/Cache/Backend/Memcached.php');
// Рефакторинг: переход на конфигурационные массивы
// $aConfigMem=include(DIR_SERVER_ROOT."/config/config.memcache.php");
$aConfigMem=Config::Get('memcache');
$oCahe = new Dklab_Cache_Backend_MemcachedMultiload($aConfigMem);
$this->oBackendCache = new Dklab_Cache_Backend_TagEmuWrapper(new Dklab_Cache_Backend_Profiler($oCahe,array($this,'CalcStats')));
} else {
throw new Exception($this->Lang_Get('system_error_cache_type').": ".$this->sCacheType." (file, memory)");
throw new Exception("Wrong type of caching: ".$this->sCacheType." (file, memory)");
}
/**
* Дабы не засорять место протухшим кешем, удаляем его в случайном порядке, например 1 из 50 раз
@ -91,7 +89,6 @@ class LsCache extends Module {
if (rand(1,50)==33) {
$this->Clean(Zend_Cache::CLEANING_MODE_OLD);
}
//$this->Clean();
}
@ -101,7 +98,7 @@ class LsCache extends Module {
* @param string $sName
* @return unknown
*/
public function Get($sName) {//var_dump($sName);
public function Get($sName) {
if (!$this->bUseCache) {
return false;
}
@ -123,8 +120,8 @@ class LsCache extends Module {
/**
* псевдо поддержка мульти-запросов к кешу
*
* @param unknown_type $aName
* @return unknown
* @param array $aName
* @return bool|array
*/
public function multiGet($aName) {
if (count($aName)==0) {
@ -139,17 +136,14 @@ class LsCache extends Module {
}
$data=$this->oBackendCache->load($aKeys);
if ($data and is_array($data)) {
//var_dump($data);
$aData=array();
foreach ($data as $key => $value) {
$aData[$aKv[$key]]=$value;
//var_dump($key);
if ($key==0) {
//var_dump($aName);
}
}
if (count($aData)>0) {
//var_dump($aData);
return $aData;
}
}
@ -170,10 +164,10 @@ class LsCache extends Module {
/**
* Записать значение в кеш
*
* @param unknown_type $data
* @param string $sName
* @param array $aTags
* @param int $iTimeLife
* @param mixed $data
* @param string $sName
* @param array $aTags
* @param int $iTimeLife
* @return bool
*/
public function Set($data,$sName,$aTags=array(),$iTimeLife=false) {
@ -232,13 +226,11 @@ class LsCache extends Module {
}
if ($sMethod=='Dklab_Cache_Backend_Profiler::save') {
$this->aStats['count_set']++;
}
//dump($sMethod);
}
}
public function GetStats() {
return $this->aStats;
}
}
?>

View file

@ -258,7 +258,7 @@ class LsViewer extends Module {
if ($this->TemplateExists($sTemplate)) {
$this->oSmarty->display($sTemplate);
} else {
throw new Exception($this->Lang_Get('system_error_template').': '.$sTemplate);
throw new Exception('Can not find the template: '.$sTemplate);
}
}
/**
@ -439,7 +439,7 @@ class LsViewer extends Module {
/**
* Считаем что тип не определен
*/
throw new Exception($this->Lang_Get('system_error_template_block').': '.$sName);
throw new Exception('Can not find the block`s template: '.$sName);
return 'undefined';
}
}