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


PHP XPClass::getClassLoader方法代碼示例

本文整理匯總了PHP中XPClass::getClassLoader方法的典型用法代碼示例。如果您正苦於以下問題:PHP XPClass::getClassLoader方法的具體用法?PHP XPClass::getClassLoader怎麽用?PHP XPClass::getClassLoader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XPClass的用法示例。


在下文中一共展示了XPClass::getClassLoader方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: uriFor

 /**
  * Tries to get class uri via reflection
  *
  * @param lang.XPClass class The class to return the URI for
  * @return string
  */
 private function uriFor(XPClass $class)
 {
     try {
         $Urimethod = $class->getClassLoader()->getClass()->getMethod('classURI');
         $Urimethod->setAccessible(TRUE);
         return $Urimethod->invoke($class->getClassLoader(), $class->getName());
     } catch (Exception $ignored) {
         return $class->getClassName();
     }
 }
開發者ID:melogamepay,項目名稱:xp-framework,代碼行數:16,代碼來源:XmlTestListener.class.php

示例2: main

 /**
  * Main
  *
  * @param  string[] $args
  * @return int
  */
 public static function main(array $args)
 {
     $command = null;
     if (empty($args)) {
         $class = new XPClass(self::class);
         $source = $class->getClassLoader();
         $markdown = $class->getComment();
     } else {
         if ('@' === $args[0][0]) {
             $resource = substr($args[0], 1);
             if (null === ($source = ClassLoader::getDefault()->findResource($resource))) {
                 Console::$err->writeLine('No help topic named ', $resource);
                 return 2;
             }
             $markdown = $source->getResource($resource);
         } else {
             $class = $args[0];
             if (null === ($source = ClassLoader::getDefault()->findClass($class))) {
                 Console::$err->writeLine('No class named ', $class);
                 return 2;
             }
             $markdown = $source->loadClass($class)->getComment();
         }
     }
     self::render(Console::$out, $markdown, $source);
     return 1;
 }
開發者ID:xp-framework,項目名稱:core,代碼行數:33,代碼來源:Help.class.php

示例3: forClass

 /**
  * Get instance for class
  *
  * @param   lang.XPClass class
  * @return  remote.server.BeanContainer
  */
 public static function forClass(XPClass $class)
 {
     $bc = new self();
     $bc->instancePool = new Vector();
     $bc->poolClass = $class;
     // Fetch class' classloader to check for resources configured
     // for the bean.
     $cl = $class->getClassLoader();
     // Try loading the well known resources, and remember if it exists
     $bc->configuration['log.ini'] = $cl->providesResource('etc/log.ini');
     $bc->configuration['database.ini'] = $cl->providesResource('etc/log.ini');
     $bc->configuration['cl'] = $cl;
     return $bc;
 }
開發者ID:melogamepay,項目名稱:xp-framework,代碼行數:20,代碼來源:StatelessSessionBeanContainer.class.php


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