当前位置: 首页>>代码示例>>PHP>>正文


PHP org_tubepress_impl_classloader_ClassLoader::loadClass方法代码示例

本文整理汇总了PHP中org_tubepress_impl_classloader_ClassLoader::loadClass方法的典型用法代码示例。如果您正苦于以下问题:PHP org_tubepress_impl_classloader_ClassLoader::loadClass方法的具体用法?PHP org_tubepress_impl_classloader_ClassLoader::loadClass怎么用?PHP org_tubepress_impl_classloader_ClassLoader::loadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org_tubepress_impl_classloader_ClassLoader的用法示例。


在下文中一共展示了org_tubepress_impl_classloader_ClassLoader::loadClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     self::$_mockCache = array();
     $ioc = \Mockery::mock('org_tubepress_api_ioc_IocService');
     $ioc->shouldReceive('get')->zeroOrMoreTimes()->andReturnUsing(function ($className) {
         if (!array_key_exists($className, TubePressUnitTest::$_mockCache)) {
             org_tubepress_impl_classloader_ClassLoader::loadClass($className);
             $mock = \Mockery::mock($className);
             TubePressUnitTest::$_mockCache[$className] = $mock;
             if (!is_a($mock, $className)) {
                 TubePressUnitTest::fail("Failed to built mock of {$className}");
             }
         }
         return TubePressUnitTest::$_mockCache[$className];
     });
     org_tubepress_impl_ioc_IocContainer::setInstance($ioc);
 }
开发者ID:nidalhajaj,项目名称:tubepress,代码行数:17,代码来源:TubePressUnitTest.php

示例2: getInstance

 /**
  * Get the singleton inversion of control container.
  *
  * @return org_tubepress_api_ioc_IocService The singleton IOC container.
  */
 public static function getInstance()
 {
     /* see if we already built one */
     if (isset(self::$_instance)) {
         return self::$_instance;
     }
     $detector = new org_tubepress_impl_environment_SimpleEnvironmentDetector();
     if ($detector->isPro()) {
         if ($detector->isWordPress()) {
             org_tubepress_impl_classloader_ClassLoader::loadClass('org_tubepress_impl_ioc_ProInWordPressIocService');
             self::$_instance = new org_tubepress_impl_ioc_ProInWordPressIocService();
         } else {
             org_tubepress_impl_classloader_ClassLoader::loadClass('org_tubepress_impl_ioc_ProIocService');
             self::$_instance = new org_tubepress_impl_ioc_ProIocService();
         }
     } else {
         org_tubepress_impl_classloader_ClassLoader::loadClass('org_tubepress_impl_ioc_FreeWordPressPluginIocService');
         self::$_instance = new org_tubepress_impl_ioc_FreeWordPressPluginIocService();
     }
     return self::$_instance;
 }
开发者ID:nidalhajaj,项目名称:tubepress,代码行数:26,代码来源:IocContainer.class.php

示例3: _buildInterface

 private function _buildInterface($interfaceName, $implementationName)
 {
     class_exists($interfaceName) || org_tubepress_impl_classloader_ClassLoader::loadClass($interfaceName);
     class_exists($implementationName) || org_tubepress_impl_classloader_ClassLoader::loadClass($implementationName);
     /* build the implementation */
     $instance = $this->_buildAndRemember($interfaceName, $implementationName);
     /* make sure the class looks OK */
     if (!$instance instanceof $interfaceName) {
         throw new Exception("{$implementationName} does not implement {$interfaceName}, but they were bound together");
     }
     return $instance;
 }
开发者ID:nidalhajaj,项目名称:tubepress,代码行数:12,代码来源:TubePressIocService.class.php

示例4: define

<?php

define('BASE', realpath(dirname(__FILE__) . '/../../'));
/** Load up PHPUnit */
#require_once 'PHPUnit/Framework.php';
/** Load up PHPMockery */
require_once 'Mockery/Loader.php';
require_once 'Hamcrest/hamcrest.php';
$loader = new \Mockery\Loader();
$loader->register();
/** Load up the mock function stuff */
require_once 'phpunit/MockFunction.php';
/** Load up the class loader */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require BASE . '/sys/classes/org/tubepress/impl/classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClass('org_tubepress_impl_ioc_IocContainer');
/** Load up the test base classes */
require_once 'TubePressUnitTestSuite.php';
require_once 'TubePressUnitTest.php';
/** Set the tubepress_base_url */
global $tubepress_base_url;
$tubepress_base_url = '<tubepress_base_url>';
/** Load up the ReturnMapping stuff */
require_once 'phpunit/ReturnMapping/ReturnMapping.php';
require_once 'phpunit/ReturnMapping/ReturnMapping/Builder.php';
require_once 'phpunit/ReturnMapping/ReturnMapping/Entry.php';
require_once 'phpunit/ReturnMapping/ReturnMapping/EntryBuilder.php';
开发者ID:nidalhajaj,项目名称:tubepress,代码行数:26,代码来源:testBootStrap.php


注:本文中的org_tubepress_impl_classloader_ClassLoader::loadClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。