Skip to content

Commit

Permalink
Merge branch '9.6' into 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Apr 20, 2024
2 parents 9e3baf9 + 33a0610 commit 9d1c41f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .phive/phars.xml
Expand Up @@ -4,5 +4,5 @@
<phar name="php-cs-fixer" version="^3.53" installed="3.54.0" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^5.23" installed="5.23.1" location="./tools/psalm" copy="true"/>
<phar name="humbug/php-scoper" version="^0.18" installed="0.18.11" location="./tools/php-scoper" copy="true"/>
<phar name="composer" version="^2.7" installed="2.7.2" location="./tools/composer" copy="true"/>
<phar name="composer" version="^2.7" installed="2.7.3" location="./tools/composer" copy="true"/>
</phive>
34 changes: 33 additions & 1 deletion build/scripts/phar-set-timestamps/run.php
Expand Up @@ -10,8 +10,40 @@

if (is_string(getenv('SOURCE_DATE_EPOCH'))) {
$epoch = (int) getenv('SOURCE_DATE_EPOCH');

printf(
'Setting timestamp of files in PHAR to %d (based on environment variable SOURCE_DATE_EPOCH)' . PHP_EOL,
$epoch
);
} else {
$epoch = (int) trim(shell_exec('git log -1 --format=%at ' . trim(shell_exec('git describe --abbrev=0'))));
$tag = @shell_exec('git describe --abbrev=0 2>&1');

if (is_string($tag) && strpos($tag, 'fatal') === false) {
$tmp = @shell_exec('git log -1 --format=%at ' . trim($tag) . ' 2>&1');

if (is_string($tag) && is_numeric(trim($tmp))) {
$epoch = (int) trim($tmp);

printf(
'Setting timestamp of files in PHAR to %d (based on when tag %s was created)' . PHP_EOL,
$epoch,
trim($tag)
);
}

unset($tmp);
}

unset($tag);
}

if (!isset($epoch)) {
$epoch = time();

printf(
'Setting timestamp of files in PHAR to %d (based on current time)' . PHP_EOL,
$epoch
);
}

$timestamp = new DateTime;
Expand Down
Binary file modified tools/composer
Binary file not shown.

0 comments on commit 9d1c41f

Please sign in to comment.