當前位置: 首頁>>代碼示例>>PHP>>正文


PHP org_glizy_ObjectFactory::resolveClass方法代碼示例

本文整理匯總了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;
 }
開發者ID:GruppoMeta,項目名稱:Movio,代碼行數:48,代碼來源:ObjectFactory.php


注:本文中的org_glizy_ObjectFactory::resolveClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。