mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-20 17:58:24 +03:00
удаление остатков от custom классов
This commit is contained in:
parent
28a809b622
commit
43addcef3a
|
@ -42,13 +42,7 @@ class Engine extends Object {
|
||||||
public $iTimeLoadModule=0;
|
public $iTimeLoadModule=0;
|
||||||
protected $iTimeInit=null;
|
protected $iTimeInit=null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Массив содержит меппер кастомизации сущностей
|
|
||||||
*
|
|
||||||
* @var arrat
|
|
||||||
*/
|
|
||||||
static protected $aEntityCustoms=array();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* При создании объекта делаем инициализацию
|
* При создании объекта делаем инициализацию
|
||||||
*
|
*
|
||||||
|
@ -485,43 +479,7 @@ class Engine extends Object {
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unknown entity '{$sName}' given.");
|
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)
|
$sClass=isset($sPlugin)
|
||||||
? 'Plugin'.$sPlugin.'_Module'.$sModule.'_Entity'.$sEntity
|
? 'Plugin'.$sPlugin.'_Module'.$sModule.'_Entity'.$sEntity
|
||||||
: '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)) {
|
if (preg_match("/^Module(\w+)\_Entity(\w+)$/i",$sClassName,$aMatch)) {
|
||||||
$tm1=microtime(true);
|
$tm1=microtime(true);
|
||||||
|
|
||||||
$sFileClass= (substr($aMatch[2],-7)=='_custom')
|
$sFileClass=Config::get('path.root.server').'/classes/modules/'.strtolower($aMatch[1]).'/entity/'.$aMatch[2].'.entity.class.php';
|
||||||
? 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';
|
|
||||||
|
|
||||||
if (file_exists($sFileClass)) {
|
if (file_exists($sFileClass)) {
|
||||||
require_once($sFileClass);
|
require_once($sFileClass);
|
||||||
|
|
|
@ -179,17 +179,11 @@ class Router extends Object {
|
||||||
*/
|
*/
|
||||||
if(!preg_match('/^Plugin([\w]+)_Action([\w]+)$/i',$sActionClass,$aMatches)) {
|
if(!preg_match('/^Plugin([\w]+)_Action([\w]+)$/i',$sActionClass,$aMatches)) {
|
||||||
require_once(Config::Get('path.root.server').'/classes/actions/'.$sActionClass.'.class.php');
|
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 {
|
} else {
|
||||||
require_once(Config::Get('path.root.server').'/plugins/'.strtolower($aMatches[1]).'/classes/actions/Action'.ucfirst($aMatches[2]).'.class.php');
|
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);
|
$this->oAction=new $sClassName($this->oEngine,self::$sAction);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue