本文整理汇总了PHP中Engine::GetClassInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine::GetClassInfo方法的具体用法?PHP Engine::GetClassInfo怎么用?PHP Engine::GetClassInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine::GetClassInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoload
public static function autoload($sClassName)
{
if (!class_exists('Engine')) {
return;
}
$aInfo = Engine::GetClassInfo($sClassName, Engine::CI_CLASSPATH | Engine::CI_INHERIT);
if ($aInfo[Engine::CI_INHERIT]) {
$sInheritClass = $aInfo[Engine::CI_INHERIT];
$sParentClass = self::GetParentInherit($sInheritClass);
if (class_alias($sParentClass, $sClassName)) {
return true;
}
}
}
示例2: autoload
/**
* Автозагрузка классов
*
* @param string $sClassName Название класса
* @return bool
*/
public static function autoload($sClassName)
{
$aInfo = Engine::GetClassInfo($sClassName, Engine::CI_CLASSPATH | Engine::CI_INHERIT);
if ($aInfo[Engine::CI_INHERIT]) {
$sInheritClass = $aInfo[Engine::CI_INHERIT];
$sParentClass = Engine::getInstance()->Plugin_GetParentInherit($sInheritClass);
if (!class_alias($sParentClass, $sClassName)) {
dump("(autoload {$sParentClass}) Can not load CLASS-file");
} else {
return true;
}
} elseif ($aInfo[Engine::CI_CLASSPATH]) {
require_once $aInfo[Engine::CI_CLASSPATH];
return true;
} elseif (!class_exists($sClassName)) {
dump("(autoload {$sClassName}) Can not load CLASS-file");
dump($aInfo);
//throw new Exception("(autoload '$sClassName') Can not load CLASS-file");
}
return false;
}
示例3: _Method
/**
* Проксирует вызов методов в модуль сущности
*
* @param unknown_type $sName
* @return unknown
*/
protected function _Method($sName)
{
$sModuleName = Engine::GetModuleName($this);
$sEntityName = Engine::GetEntityName($this);
$sPluginPrefix = Engine::GetPluginPrefix($this);
/**
* If Module not exists, try to find its root Delegater
*/
$aClassInfo = Engine::GetClassInfo($sPluginPrefix . 'Module_' . $sModuleName, Engine::CI_MODULE);
if (empty($aClassInfo[Engine::CI_MODULE]) && ($sRootDelegater = $this->Plugin_GetRootDelegater('entity', get_class($this)))) {
$sModuleName = Engine::GetModuleName($sRootDelegater);
$sPluginPrefix = Engine::GetPluginPrefix($sRootDelegater);
}
return Engine::GetInstance()->_CallModule("{$sPluginPrefix}{$sModuleName}_{$sName}{$sEntityName}", array($this));
}
示例4: autoload
/**
* Автозагрузка классов
*
* @param string $sClassName Название класса
* @return bool
*/
public static function autoload($sClassName)
{
$aInfo = Engine::GetClassInfo($sClassName, Engine::CI_CLASSPATH | Engine::CI_INHERIT);
if ($aInfo[Engine::CI_INHERIT]) {
$sInheritClass = $aInfo[Engine::CI_INHERIT];
$sParentClass = Engine::getInstance()->Plugin_GetParentInherit($sInheritClass);
if (class_alias($sParentClass, $sClassName)) {
return true;
}
} elseif ($aInfo[Engine::CI_CLASSPATH]) {
require_once $aInfo[Engine::CI_CLASSPATH];
return true;
} elseif (!class_exists($sClassName)) {
/**
* Проверяем соответствие PSR-0
*/
$sClassName = ltrim($sClassName, '\\');
$sFileName = '';
$sNameSpace = '';
if ($iLastNsPos = strrpos($sClassName, '\\')) {
$sNameSpace = substr($sClassName, 0, $iLastNsPos);
$sClassName = substr($sClassName, $iLastNsPos + 1);
$sFileName = str_replace('\\', DIRECTORY_SEPARATOR, $sNameSpace) . DIRECTORY_SEPARATOR;
}
$sFileName .= str_replace('_', DIRECTORY_SEPARATOR, $sClassName) . '.php';
$sFileName = Config::Get('path.framework.libs_vendor.server') . DIRECTORY_SEPARATOR . $sFileName;
if (file_exists($sFileName)) {
require_once $sFileName;
return true;
}
//throw new Exception("(autoload '$sClassName') Can not load CLASS-file");
}
return false;
}