From 43addcef3a00a6ff7e7904abbba117c0d50f1a25 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sun, 6 Jun 2010 13:46:03 +0000 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=D1=81=D1=82=D0=B0=D1=82=D0=BA=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=BE=D1=82=20custom=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/classes/Engine.class.php | 50 ++------------------------------- engine/classes/Router.class.php | 8 +----- 2 files changed, 4 insertions(+), 54 deletions(-) diff --git a/engine/classes/Engine.class.php b/engine/classes/Engine.class.php index 38263ffb..976d8396 100644 --- a/engine/classes/Engine.class.php +++ b/engine/classes/Engine.class.php @@ -42,13 +42,7 @@ class Engine extends Object { public $iTimeLoadModule=0; protected $iTimeInit=null; - /** - * Массив содержит меппер кастомизации сущностей - * - * @var arrat - */ - static protected $aEntityCustoms=array(); - + /** * При создании объекта делаем инициализацию * @@ -485,43 +479,7 @@ class Engine extends Object { default: throw new Exception("Unknown entity '{$sName}' given."); } - - /** - * Проверяем наличие сущности в меппере кастомизации - */ - if(array_key_exists($sName,self::$aEntityCustoms)) { - $sEntity = (self::$aEntityCustoms[$sName]=='custom') - ? $sEntity.'_custom' - : $sEntity; - } else { - $sFileDefaultClass=isset($sPlugin) - ? Config::get('path.root.server').'/plugins/'.strtolower($sPlugin).'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.php' - : Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.php'; - - $sFileCustomClass=isset($sPlugin) - ? Config::get('path.root.server').'/plugins/'.strtolower($sPlugin).'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.custom.php' - : Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.custom.php'; - - /** - * Пытаемся найти кастомизированную сущность - */ - if(file_exists($sFileCustomClass)) { - $sFileClass=$sFileCustomClass; - $sEntity.='_custom'; - self::$aEntityCustoms[$sName]='custom'; - } elseif(file_exists($sFileDefaultClass)) { - $sFileClass=$sFileDefaultClass; - self::$aEntityCustoms[$sName]='default'; - } else { - throw new Exception('Entity class not found'); - return null; - } - /** - * Подгружаем нужный файл - */ - require_once($sFileClass); - } - + $sClass=isset($sPlugin) ? 'Plugin'.$sPlugin.'_Module'.$sModule.'_Entity'.$sEntity : 'Module'.$sModule.'_Entity'.$sEntity; @@ -548,9 +506,7 @@ function __autoload($sClassName) { if (preg_match("/^Module(\w+)\_Entity(\w+)$/i",$sClassName,$aMatch)) { $tm1=microtime(true); - $sFileClass= (substr($aMatch[2],-7)=='_custom') - ? Config::get('path.root.server').'/classes/modules/'.strtolower($aMatch[1]).'/entity/'.substr($aMatch[2],0,strlen($aMatch[2])-7).'.entity.class.custom.php' - : Config::get('path.root.server').'/classes/modules/'.strtolower($aMatch[1]).'/entity/'.$aMatch[2].'.entity.class.php'; + $sFileClass=Config::get('path.root.server').'/classes/modules/'.strtolower($aMatch[1]).'/entity/'.$aMatch[2].'.entity.class.php'; if (file_exists($sFileClass)) { require_once($sFileClass); diff --git a/engine/classes/Router.class.php b/engine/classes/Router.class.php index ab8f20de..a7ac18bd 100644 --- a/engine/classes/Router.class.php +++ b/engine/classes/Router.class.php @@ -179,17 +179,11 @@ class Router extends Object { */ if(!preg_match('/^Plugin([\w]+)_Action([\w]+)$/i',$sActionClass,$aMatches)) { require_once(Config::Get('path.root.server').'/classes/actions/'.$sActionClass.'.class.php'); - $sPrefixCustom=''; - if (file_exists(Config::Get('path.root.server')."/classes/actions/".$sActionClass.'.class.custom.php')) { - require_once(Config::Get('path.root.server')."/classes/actions/".$sActionClass.'.class.custom.php'); - $sPrefixCustom='_custom'; - } } else { require_once(Config::Get('path.root.server').'/plugins/'.strtolower($aMatches[1]).'/classes/actions/Action'.ucfirst($aMatches[2]).'.class.php'); - $sPrefixCustom=''; } - $sClassName=$sActionClass.$sPrefixCustom; + $sClassName=$sActionClass; $this->oAction=new $sClassName($this->oEngine,self::$sAction); /**