forked from composer/composer
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request composer#1051 from HosipLan/bug/require-files-in-r…
…ight-order Require files in right order
- Loading branch information
Showing
4 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
tests/Composer/Test/Autoload/Fixtures/autoload_functions_by_dependency.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
// autoload.php generated by Composer | ||
|
||
require_once __DIR__ . '/composer' . '/autoload_realFilesAutoloadOrder.php'; | ||
|
||
return ComposerAutoloaderInitFilesAutoloadOrder::getLoader(); |
34 changes: 34 additions & 0 deletions
34
tests/Composer/Test/Autoload/Fixtures/autoload_real_files_by_dependency.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
// autoload_realFilesAutoloadOrder.php generated by Composer | ||
|
||
require __DIR__ . '/ClassLoader.php'; | ||
|
||
class ComposerAutoloaderInitFilesAutoloadOrder | ||
{ | ||
public static function getLoader() | ||
{ | ||
$loader = new \Composer\Autoload\ClassLoader(); | ||
$vendorDir = dirname(__DIR__); | ||
$baseDir = dirname($vendorDir); | ||
|
||
$map = require __DIR__ . '/autoload_namespaces.php'; | ||
foreach ($map as $namespace => $path) { | ||
$loader->add($namespace, $path); | ||
} | ||
|
||
$classMap = require __DIR__ . '/autoload_classmap.php'; | ||
if ($classMap) { | ||
$loader->addClassMap($classMap); | ||
} | ||
|
||
$loader->register(); | ||
|
||
require $vendorDir . '/c/lorem/testC.php'; | ||
require $vendorDir . '/a/foo/testA.php'; | ||
require $baseDir . '/root.php'; | ||
require $vendorDir . '/b/bar/testB.php'; | ||
|
||
return $loader; | ||
} | ||
} |