Skip to content

Commit

Permalink
Merge branch '10.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 7, 2023
2 parents 29ca69a + 1fdfc59 commit 86f052c
Show file tree
Hide file tree
Showing 23 changed files with 1,732 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build.xml
Expand Up @@ -335,6 +335,10 @@
<arg path="${basedir}/build/tmp/phar-scoped" />
</exec>

<exec executable="${basedir}/build/scripts/phar-set-timestamps/run.php" taskname="phar-set-timestamps" failonerror="true">
<arg path="${basedir}/build/artifacts/phpunit-library-${_version}.phar" />
</exec>

<copy file="${basedir}/build/templates/binary-phar-autoload.php.in" tofile="${basedir}/build/tmp/binary-phar-autoload.php"/>
<replace file="${basedir}/build/tmp/binary-phar-autoload.php" token="X.Y.Z" value="${_version}"/>

Expand All @@ -351,6 +355,10 @@
<arg path="${basedir}/build/tmp/phar-scoped" />
</exec>

<exec executable="${basedir}/build/scripts/phar-set-timestamps/run.php" taskname="phar-set-timestamps" failonerror="true">
<arg path="${basedir}/build/artifacts/phpunit-${_version}.phar" />
</exec>

<chmod file="${basedir}/build/artifacts/phpunit-${_version}.phar" perm="ugo+rx"/>

<delete dir="${basedir}/build/tmp"/>
Expand Down
8 changes: 8 additions & 0 deletions build/scripts/phar-set-timestamps/composer.json
@@ -0,0 +1,8 @@
{
"require": {
"seld/phar-utils": "^1.2"
},
"config": {
"optimize-autoloader": true
}
}
67 changes: 67 additions & 0 deletions build/scripts/phar-set-timestamps/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions build/scripts/phar-set-timestamps/run.php
@@ -0,0 +1,22 @@
#!/usr/bin/env php
<?php declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';

if (!isset($argv[1]) || !is_file($argv[1])) {
exit(1);
}

use Seld\PharUtils\Timestamps;

$util = new Timestamps($argv[1]);

if (is_string(getenv('SOURCE_DATE_EPOCH'))) {
$timestamp = new DateTime;
$timestamp->setTimestamp((int) getenv('SOURCE_DATE_EPOCH'));
} else {
$timestamp = new DateTimeImmutable('now');
}

$util->updateTimestamps($timestamp);

$util->save($argv[1], Phar::SHA512);
25 changes: 25 additions & 0 deletions build/scripts/phar-set-timestamps/vendor/autoload.php
@@ -0,0 +1,25 @@
<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit386a05f6676643b8b2eb49288e20d079::getLoader();

0 comments on commit 86f052c

Please sign in to comment.