當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。