From 2a48b0faa0158ca8adb22f4cbd91c2566a6a06cd Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 1 May 2015 14:32:32 +0100 Subject: [PATCH] Make autoloader suffix a reproducible value as well, refs #3927 --- bin/compile | 7 +++++++ src/Composer/Compiler.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index ce98de81c..a2720a95d 100755 --- a/bin/compile +++ b/bin/compile @@ -3,9 +3,16 @@ $cwd = getcwd(); chdir(__DIR__.'/../'); +$ts = rtrim(shell_exec('git log -n1 --pretty=%ct HEAD')); +if (!is_numeric($ts)) { + echo 'Could not detect date using "git log -n1 --pretty=%ct HEAD"'.PHP_EOL; + exit(1); +} // Install with the current version to force it having the right ClassLoader version // Install without dev packages to clean up the included classmap from phpunit classes +shell_exec('php bin/composer config autoloader-suffix ComposerPhar' . $ts); shell_exec('php bin/composer install -q --no-dev'); +shell_exec('php bin/composer config autoloader-suffix --unset'); chdir($cwd); require __DIR__.'/../src/bootstrap.php'; diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 77b48825e..b3e4abcdc 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -145,7 +145,7 @@ class Compiler unset($phar); - // resign the phar with reproducible timestamp / signature + // re-sign the phar with reproducible timestamp / signature $util = new Timestamps($pharFile); $util->updateTimestamps($this->versionDate); $util->save($pharFile, \Phar::SHA1);