本文整理汇总了PHP中E::GetClassInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP E::GetClassInfo方法的具体用法?PHP E::GetClassInfo怎么用?PHP E::GetClassInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类E
的用法示例。
在下文中一共展示了E::GetClassInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Create
/**
* Creates decorator
*
* @param object $oComponent
* @param bool $bHookEnable
*
* @return Decorator
*/
static function Create($oComponent, $bHookEnable = true)
{
$sClassName = get_class($oComponent);
if (!$bHookEnable || $sClassName == 'ModulePlugin' || $sClassName == 'ModuleHook') {
return $oComponent;
}
if (DEBUG) {
$sDecoratorClassName = 'Decorator' . $sClassName;
$sDecoratorClassCode = 'class ' . $sDecoratorClassName . ' extends Decorator { }';
eval($sDecoratorClassCode);
$oComponentDecorator = new $sDecoratorClassName($oComponent);
} else {
$oComponentDecorator = new static($oComponent);
}
$aClassInfo = E::GetClassInfo($oComponent, Engine::CI_ACTION | Engine::CI_MODULE);
if ($aClassInfo[Engine::CI_ACTION]) {
$oComponentDecorator->setType('action');
$oComponentDecorator->setName($aClassInfo[Engine::CI_ACTION]);
$oComponentDecorator->setHookEnable(true);
} elseif ($aClassInfo[Engine::CI_MODULE]) {
$oComponentDecorator->setType('module');
$oComponentDecorator->setName($aClassInfo[Engine::CI_MODULE]);
$oComponentDecorator->setHookEnable(true);
}
return $oComponentDecorator;
}
示例2: Create
/**
* Creates decorator
*
* @param object $oComponent
* @param bool $bHookEnable
*
* @return object
*/
static function Create($oComponent, $bHookEnable = true)
{
$sClassName = get_class($oComponent);
if (!$bHookEnable || $sClassName == 'ModulePlugin' || $sClassName == 'ModuleHook') {
return $oComponent;
}
$oComponentDecorator = new static($oComponent);
$aClassInfo = E::GetClassInfo($oComponent, Engine::CI_ACTION | Engine::CI_MODULE);
if ($aClassInfo[Engine::CI_ACTION]) {
$oComponentDecorator->setType('action');
$oComponentDecorator->setName($aClassInfo[Engine::CI_ACTION]);
$oComponentDecorator->setHookEnable(true);
} elseif ($aClassInfo[Engine::CI_MODULE]) {
$oComponentDecorator->setType('module');
$oComponentDecorator->setName($aClassInfo[Engine::CI_MODULE]);
$oComponentDecorator->setHookEnable(true);
}
return $oComponentDecorator;
}
示例3: Autoload
/**
* Автозагрузка классов
*
* @param string $sClassName Название класса
*
* @return bool
*/
public static function Autoload($sClassName)
{
if ($sParentClass = Config::Get('classes.alias.' . $sClassName)) {
return self::_classAlias($sParentClass, $sClassName);
}
if (self::_autoloadDefinedClass($sClassName)) {
return true;
}
if (class_exists('Engine', false) && E::GetStage() >= E::STAGE_INIT) {
$aInfo = E::GetClassInfo($sClassName, E::CI_CLASSPATH | E::CI_INHERIT);
if ($aInfo[E::CI_INHERIT]) {
$sInheritClass = $aInfo[E::CI_INHERIT];
$sParentClass = E::ModulePlugin()->GetParentInherit($sInheritClass);
return self::_classAlias($sParentClass, $sClassName);
} elseif ($aInfo[E::CI_CLASSPATH]) {
return self::_includeFile($aInfo[E::CI_CLASSPATH], $sClassName);
}
}
if (self::_autoloadPSR($sClassName)) {
return true;
}
return false;
}
示例4: _Method
/**
* Проксирует вызов методов в модуль сущности
*
* @param string $sName Название метода
*
* @return mixed
*/
protected function _Method($sName)
{
$sModuleName = E::GetModuleName($this);
$sEntityName = E::GetEntityName($this);
$sPluginPrefix = E::GetPluginPrefix($this);
/**
* If Module not exists, try to find its root Delegater
*/
$aClassInfo = E::GetClassInfo($sPluginPrefix . 'Module_' . $sModuleName, Engine::CI_MODULE);
if (empty($aClassInfo[E::CI_MODULE]) && ($sRootDelegater = E::ModulePlugin()->GetRootDelegater('entity', get_class($this)))) {
$sModuleName = E::GetModuleName($sRootDelegater);
$sPluginPrefix = E::GetPluginPrefix($sRootDelegater);
}
$aCallArgs = array($this);
return E::GetInstance()->_CallModule("{$sPluginPrefix}{$sModuleName}_{$sName}{$sEntityName}", $aCallArgs);
}