1
0
Fork 0

Always prepend autoloaders to avoid tools (i.e. phpunit) taking precedence over the project autoloader

pull/1467/head
Jordi Boggiano 2013-01-08 17:34:37 +01:00
parent 1356021cb9
commit c80cb76b9b
4 changed files with 6 additions and 6 deletions

View File

@ -405,7 +405,7 @@ CLASSMAP;
if ($targetDirLoader) {
$file .= <<<REGISTER_AUTOLOAD
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'));
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true, true);
REGISTER_AUTOLOAD;
@ -413,7 +413,7 @@ REGISTER_AUTOLOAD;
}
$file .= <<<METHOD_FOOTER
\$loader->register();{$filesCode}
\$loader->register(true);{$filesCode}
return \$loader;
}

View File

@ -36,7 +36,7 @@ class ComposerAutoloaderInitFilesAutoloadOrder
$loader->addClassMap($classMap);
}
$loader->register();
$loader->register(true);
require $vendorDir . '/c/lorem/testC.php';
require $vendorDir . '/z/foo/testA.php';

View File

@ -36,7 +36,7 @@ class ComposerAutoloaderInitFilesAutoload
$loader->addClassMap($classMap);
}
$loader->register();
$loader->register(true);
require $vendorDir . '/a/a/test.php';
require $vendorDir . '/b/b/test2.php';

View File

@ -36,9 +36,9 @@ class ComposerAutoloaderInitTargetDir
$loader->addClassMap($classMap);
}
spl_autoload_register(array('ComposerAutoloaderInitTargetDir', 'autoload'));
spl_autoload_register(array('ComposerAutoloaderInitTargetDir', 'autoload'), true, true);
$loader->register();
$loader->register(true);
return $loader;
}