diff --git a/bin/compile b/bin/compile index c4a6b1105..e1acab34c 100755 --- a/bin/compile +++ b/bin/compile @@ -1,6 +1,11 @@ #!/usr/bin/env php compile(); } catch (\Exception $e) { - echo 'Failed to compile phar: ['.get_class($e).'] '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine(); + echo 'Failed to compile phar: ['.get_class($e).'] '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().PHP_EOL; exit(1); } diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index b5db79304..b7979ef2b 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -73,6 +73,10 @@ class Compiler $phar->startBuffering(); + $finderSort = function ($a, $b) { + return strcmp($a, $b); + }; + $finder = new Finder(); $finder->files() ->ignoreVCS(true) @@ -80,6 +84,7 @@ class Compiler ->notName('Compiler.php') ->notName('ClassLoader.php') ->in(__DIR__.'/..') + ->sort($finderSort) ; foreach ($finder as $file) { @@ -91,6 +96,7 @@ class Compiler $finder->files() ->name('*.json') ->in(__DIR__ . '/../../res') + ->sort($finderSort) ; foreach ($finder as $file) { @@ -109,6 +115,7 @@ class Compiler ->in(__DIR__.'/../../vendor/symfony/') ->in(__DIR__.'/../../vendor/seld/jsonlint/') ->in(__DIR__.'/../../vendor/justinrainbow/json-schema/') + ->sort($finderSort) ; foreach ($finder as $file) {