Always prepend autoloaders to avoid tools (i.e. phpunit) taking precedence over the project autoloader
parent
1356021cb9
commit
c80cb76b9b
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue