Merge pull request #883 from sylvainfilteau/feature-prepend-include-path
Change the order of the include pathspull/893/head
commit
cc063cce94
|
@ -300,7 +300,7 @@ HEADER;
|
||||||
if ($useIncludePath) {
|
if ($useIncludePath) {
|
||||||
$file .= <<<'INCLUDE_PATH'
|
$file .= <<<'INCLUDE_PATH'
|
||||||
$includePaths = require $composerDir . '/include_paths.php';
|
$includePaths = require $composerDir . '/include_paths.php';
|
||||||
array_unshift($includePaths, get_include_path());
|
array_push($includePaths, get_include_path());
|
||||||
set_include_path(join(PATH_SEPARATOR, $includePaths));
|
set_include_path(join(PATH_SEPARATOR, $includePaths));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -338,7 +338,7 @@ class AutoloadGeneratorTest extends TestCase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIncludePathsAreAppendedInAutoloadFile()
|
public function testIncludePathsArePrependedInAutoloadFile()
|
||||||
{
|
{
|
||||||
$package = new MemoryPackage('a', '1.0', '1.0');
|
$package = new MemoryPackage('a', '1.0', '1.0');
|
||||||
$packages = array();
|
$packages = array();
|
||||||
|
@ -361,7 +361,7 @@ class AutoloadGeneratorTest extends TestCase
|
||||||
require($this->vendorDir."/autoload.php");
|
require($this->vendorDir."/autoload.php");
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$oldIncludePath.PATH_SEPARATOR.$this->vendorDir."/a/a/lib",
|
$this->vendorDir."/a/a/lib".PATH_SEPARATOR.$oldIncludePath,
|
||||||
get_include_path()
|
get_include_path()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue