Autoload generator cleanups
parent
3748c11709
commit
1fe690f810
|
@ -237,11 +237,6 @@ EOF;
|
||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// $whitelist = sprintf(
|
|
||||||
// '{%s/%s.+$}',
|
|
||||||
// preg_quote($dir),
|
|
||||||
// ($psrType === 'psr-0' && strpos($namespace, '_') === false) ? preg_quote(strtr($namespace, '\\', '/')) : ''
|
|
||||||
// );
|
|
||||||
|
|
||||||
$namespaceFilter = $namespace === '' ? null : $namespace;
|
$namespaceFilter = $namespace === '' ? null : $namespace;
|
||||||
$classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespaceFilter, $classMap);
|
$classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespaceFilter, $classMap);
|
||||||
|
@ -544,13 +539,6 @@ AUTOLOAD;
|
||||||
|
|
||||||
protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $useIncludeFiles, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader)
|
protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $useIncludeFiles, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader)
|
||||||
{
|
{
|
||||||
// TODO the class ComposerAutoloaderInit should be revert to a closure
|
|
||||||
// when APC has been fixed:
|
|
||||||
// - https://github.com/composer/composer/issues/959
|
|
||||||
// - https://bugs.php.net/bug.php?id=52144
|
|
||||||
// - https://bugs.php.net/bug.php?id=61576
|
|
||||||
// - https://bugs.php.net/bug.php?id=59298
|
|
||||||
|
|
||||||
$file = <<<HEADER
|
$file = <<<HEADER
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -634,11 +622,11 @@ INCLUDEPATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($targetDirLoader) {
|
if ($targetDirLoader) {
|
||||||
$file .= <<<REGISTER_AUTOLOAD
|
$file .= <<<REGISTER_TARGET_DIR_AUTOLOAD
|
||||||
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true, true);
|
||||||
|
|
||||||
|
|
||||||
REGISTER_AUTOLOAD;
|
REGISTER_TARGET_DIR_AUTOLOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file .= <<<REGISTER_LOADER
|
$file .= <<<REGISTER_LOADER
|
||||||
|
@ -666,7 +654,8 @@ METHOD_FOOTER;
|
||||||
|
|
||||||
$file .= $targetDirLoader;
|
$file .= $targetDirLoader;
|
||||||
|
|
||||||
return $file . <<<FOOTER
|
if ($useIncludeFiles) {
|
||||||
|
return $file . <<<FOOTER
|
||||||
}
|
}
|
||||||
|
|
||||||
function composerRequire$suffix(\$fileIdentifier, \$file)
|
function composerRequire$suffix(\$fileIdentifier, \$file)
|
||||||
|
@ -678,6 +667,13 @@ function composerRequire$suffix(\$fileIdentifier, \$file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FOOTER;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $file . <<<FOOTER
|
||||||
|
}
|
||||||
|
|
||||||
FOOTER;
|
FOOTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,3 @@ class ComposerAutoloaderInitFilesAutoload
|
||||||
return $loader;
|
return $loader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function composerRequireFilesAutoload($file)
|
|
||||||
{
|
|
||||||
require $file;
|
|
||||||
}
|
|
||||||
|
|
|
@ -64,16 +64,3 @@ class ComposerAutoloaderInitIncludePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function composerRequireIncludePath($fileIdentifier, $file)
|
|
||||||
{
|
|
||||||
if (empty($GLOBALS['composerRequiredFiles'])) {
|
|
||||||
$GLOBALS['composerRequiredFiles'] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($GLOBALS['composerRequiredFiles'][$fileIdentifier])) {
|
|
||||||
require $file;
|
|
||||||
|
|
||||||
$GLOBALS['composerRequiredFiles'][$fileIdentifier] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue