本文整理汇总了PHP中Autoloader::getIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::getIndex方法的具体用法?PHP Autoloader::getIndex怎么用?PHP Autoloader::getIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoloader
的用法示例。
在下文中一共展示了Autoloader::getIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBuildIndex
/**
* Asserts that Autoloader::buildIndex() stores all class definitions
* in its index
*
* @param Autoloader $autoloader The tested Autoloader instance
* @param Array $expectedPaths A list of all class definitions
*
* @dataProvider provideTestBuildIndex
* @see Autoloader::buildIndex()
* @return void
*/
public function testBuildIndex(Autoloader $autoloader, array $expectedPaths)
{
$autoloader->buildIndex();
$foundPaths = $autoloader->getIndex()->getPaths();
ksort($foundPaths);
ksort($expectedPaths);
$this->assertEquals($expectedPaths, $foundPaths);
}
示例2: unlink
* setup autoloader
*/
require_once PATH_DEPENDING . "classes/autoloader/Autoloader.php";
Autoloader::getRegisteredAutoloader()->remove();
$autoloaderIndexFile = PATH_TEMP . "koala_autoloader.gz";
if (DEVELOPMENT_MODE && browserNoCache() && !isAjaxRequest() && !isPhpCli()) {
if (file_exists($autoloaderIndexFile)) {
unlink($autoloaderIndexFile);
}
}
if (dropCache() && !isAjaxRequest()) {
emptyCacheFolder();
}
$autoloader = new Autoloader(PATH_BASE);
$autoloader->register();
$autoloader->getIndex()->setIndexPath($autoloaderIndexFile);
$autoloader->getFileIterator()->setOnlyDirPattern("~/((core)|(depending)|(extensions))~");
$autoloader->getFileIterator()->setOnlyFilePattern("~\\.php\$~i");
$autoloader->getFileIterator()->addSkipDirPattern("~/((javascript)|(\\.settings)|(\\.todo)|(cache)|(log)|(temp))~");
$autoloader->getFileIterator()->addSkipFilePattern("~/\\.~");
if (apache_getenv("AUTOLOADER_BUILD_RUNNING")) {
die("System Initialisation is running. Please wait.");
}
if (!file_exists($autoloaderIndexFile)) {
displayStartupUserInfo();
try {
apache_setenv("AUTOLOADER_BUILD_RUNNING", true);
$autoloader->buildIndex();
apache_setenv("AUTOLOADER_BUILD_RUNNING", false);
} catch (AutoloaderException $e) {
if ($e instanceof AutoloaderException_Parser_IO) {
示例3: Autoloader
<?php
error_reporting((E_ALL | E_NOTICE) & ~E_DEPRECATED);
define("PATH_ROOT", "/Volumes/Users/Entwicklung/php/workspace/koala-2_1/classes/");
define("PATH_UNITTEST", "/Volumes/Users/Entwicklung/php/workspace/koala-2_1/classes/PHPsTeam/unittest/");
/*require(PATH_ROOT . 'Autoloader.class.php');
Autoloader::setCacheFilePath(PATH_ROOT . '../temp/class_path_cache.txt');
Autoloader::excludeFolderNamesMatchingRegex('/^CVS|\..*$/');
Autoloader::setClassPaths(array(
PATH_ROOT . "PHPsTeam/"
));
spl_autoload_register(array('Autoloader', 'loadClass'));*/
require PATH_ROOT . "autoloader/Autoloader.php";
Autoloader::getRegisteredAutoloader()->remove();
$autoloader = new Autoloader(PATH_ROOT);
$autoloader->register();
$autoloader->getIndex()->setIndexPath(PATH_ROOT . "../temp/phpsteam_unittest_autoloader.gz");
require_once 'classes/autorun.php';
//require_once PATH_UNITTEST . 'classes/simpletest.php';
//require_once PATH_UNITTEST . 'inc/showpasses.class.php';
SimpleTest::prefer(new showpasses());
class PHPsTeam_TestSuite extends TestSuite
{
function PHPsTeam_TestSuite()
{
$this->TestSuite("all PHPsTeam unit tests");
$this->addFile(PATH_UNITTEST . "steam_connector_test.class.php");
$this->addFile(PATH_UNITTEST . "steam_factory_test.class.php");
$this->addFile(PATH_UNITTEST . "steam_document_test.class.php");
}
}