From bda2c0f9b7dfc24616fe273d06f816a61abec9ef Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 9 Jan 2016 19:12:26 +0000 Subject: [PATCH] Re-enable include path even when classmap authoritative is present, refs #4556 --- src/Composer/Autoload/AutoloadGenerator.php | 40 ++++++++++----------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 391318832..eaae8ec69 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -568,34 +568,30 @@ class ComposerAutoloaderInit$suffix HEADER; - if (!$this->classMapAuthoritative) { - if ($useIncludePath) { - $file .= <<<'INCLUDE_PATH' - $includePaths = require __DIR__ . '/include_paths.php'; - array_push($includePaths, get_include_path()); - set_include_path(join(PATH_SEPARATOR, $includePaths)); + if ($useIncludePath) { + $file .= <<<'INCLUDE_PATH' + $includePaths = require __DIR__ . '/include_paths.php'; + array_push($includePaths, get_include_path()); + set_include_path(join(PATH_SEPARATOR, $includePaths)); INCLUDE_PATH; - } + } - $file .= <<<'PSR0' - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + if (!$this->classMapAuthoritative) { + $file .= <<<'PSR04' + $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); + } -PSR0; - - $file .= <<<'PSR4' - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - -PSR4; +PSR04; } if ($useClassMap) {