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


PHP UniversalClassLoader::useIncludePath方法代码示例

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


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

示例1: testUseIncludePath

 public function testUseIncludePath()
 {
     $loader = new UniversalClassLoader();
     $this->assertFalse($loader->getUseIncludePath());
     $this->assertNull($loader->findFile('Foo'));
     $includePath = get_include_path();
     $loader->useIncludePath(true);
     $this->assertTrue($loader->getUseIncludePath());
     set_include_path(__DIR__ . '/Fixtures/includepath' . PATH_SEPARATOR . $includePath);
     $this->assertEquals(__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'includepath' . DIRECTORY_SEPARATOR . 'Foo.php', $loader->findFile('Foo'));
     set_include_path($includePath);
 }
开发者ID:joan16v,项目名称:symfony2_test,代码行数:12,代码来源:UniversalClassLoaderTest.php

示例2: UniversalClassLoader

<?php

require_once __DIR__ . '/../vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once __DIR__ . '/../vendor/autoload.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
// You can search the include_path as a last resort.
$loader->useIncludePath(true);
// ... register namespaces and prefixes here - see below
$loader->registerNamespaces(array('SagePHP' => __DIR__ . '/../src/'));
$loader->register();
开发者ID:sagephp,项目名称:ini,代码行数:11,代码来源:bootstrap.php

示例3: implode

    array_pop($urlParts);
    return implode('/', $urlParts) . '/';
}
if (get_magic_quotes_gpc()) {
    throw new Exception("magic_quotes_gpc is not supported");
}
/******************************************************************************
 * Constants
 *****************************************************************************/
define('ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
define('ROOT_URL', get_base_url());
ini_set("include_path", ROOT_PATH . 'libs' . DIRECTORY_SEPARATOR);
$loader = (require_once ROOT_PATH . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');
use Symfony\Component\ClassLoader\UniversalClassLoader;
$universalLoader = new UniversalClassLoader();
$universalLoader->useIncludePath(true);
$universalLoader->register();
require_once 'Zend/Db/Adapter/Mysqli.php';
/******************************************************************************
 * Loading of the options (default & user)
 *****************************************************************************/
if (!file_exists(ROOT_PATH . "options.php")) {
    die("The file options.php should exists, please read the instructions inside of 'options.php-example'.");
}
require_once ROOT_PATH . "options_default.php";
require_once ROOT_PATH . "options.php";
/******************************************************************************
 * Initialize all the global variables
 *****************************************************************************/
require_once ROOT_PATH . '/services.php';
$g_database = new Zend_Db_Adapter_Mysqli($g_options['mysql']);
开发者ID:Riges,项目名称:KawaiViewModel,代码行数:31,代码来源:globals.inc.php


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