1
0
Fork 0
composer/tests/Composer/Test/Autoload/Fixtures/autoload_real_functions.php

65 lines
1.7 KiB
PHP
Raw Normal View History

<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitFilesAutoload
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$loader->register(true);
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequireFilesAutoload($file);
}
return $loader;
}
}
function composerRequireFilesAutoload($file)
{
2015-06-28 20:44:43 +00:00
if (empty($GLOBALS['composerRequiredFiles'])) {
$GLOBALS['composerRequiredFiles'] = [];
}
$fileSignature = md5_file($file);
2015-06-28 20:44:43 +00:00
if (empty($GLOBALS['composerRequiredFiles'][$fileSignature])) {
require $file;
2015-06-28 20:44:43 +00:00
$GLOBALS['composerRequiredFiles'][$fileSignature] = true;
}
}