本文整理汇总了PHP中org_glizy_ObjectFactory::resolveClass方法的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory::resolveClass方法的具体用法?PHP org_glizy_ObjectFactory::resolveClass怎么用?PHP org_glizy_ObjectFactory::resolveClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org_glizy_ObjectFactory
的用法示例。
在下文中一共展示了org_glizy_ObjectFactory::resolveClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pathinfo
/**
* @param $className
* @param $application
* @param $parent
* @param $tagName
* @param $id
* @param string $originalId
* @param bool $skipImport
* @param string $mode
* @return mixed
*/
static function &createComponent($className, &$application, &$parent, $tagName, $id, $originalId = '', $skipImport = false, $mode = '')
{
$className = org_glizy_ObjectFactory::resolveClass($className);
$componentClassName = str_replace('.', '_', $className);
if (!class_exists($componentClassName)) {
// controlla se il file className.xml esiste sia nelle classi dell'applicazione
// si in quelle di sistema
// se esiste:
// deve compilarlo e caricarlo
// se non esiste
// deve dare un messaggio di errore
// TODO
// in questo modo non carica eventuali classi dal core
//
// TODO
// deve essere prevista anche la compilazione dei models se sono in PHP e non in XML
//
$fileName = glz_findClassPath($className);
$pathInfo = pathinfo($fileName);
if (empty($pathInfo['basename'])) {
trigger_error($className . ': component file not found', E_USER_ERROR);
}
if ($pathInfo['extension'] == 'xml') {
/** @var org_glizy_compilers_Component $compiler */
$compiler = org_glizy_ObjectFactory::createObject('org.glizy.compilers.Component');
$compiledFileName = $compiler->verify($fileName, array('originalClassName' => $className, 'mode' => $mode));
require_once $compiledFileName;
$componentClassName = glz_basename($compiledFileName);
} else {
require_once $fileName;
}
$newObj = new $componentClassName($application, $parent, $tagName, $id, $originalId, $skipImport);
return $newObj;
}
$newObj = new $componentClassName($application, $parent, $tagName, $id, $originalId, $skipImport);
return $newObj;
}