Explorar o código

Make autoloader suffix a reproducible value as well, refs #3927

Jordi Boggiano %!s(int64=10) %!d(string=hai) anos
pai
achega
2a48b0faa0
Modificáronse 2 ficheiros con 8 adicións e 1 borrados
  1. 7 0
      bin/compile
  2. 1 1
      src/Composer/Compiler.php

+ 7 - 0
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';

+ 1 - 1
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);