当前位置: 首页>>代码示例>>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;未经允许,请勿转载。