Skip to content

Commit 33a0610

Browse files
Merge branch '8.5' into 9.6
2 parents c752a86 + 920716c commit 33a0610

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

.phive/phars.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<phar name="php-cs-fixer" version="^3.53" installed="3.54.0" location="./tools/php-cs-fixer" copy="true"/>
55
<phar name="psalm" version="^5.23" installed="5.23.1" location="./tools/psalm" copy="true"/>
66
<phar name="humbug/php-scoper" version="^0.18" installed="0.18.11" location="./tools/php-scoper" copy="true"/>
7-
<phar name="composer" version="^2.7" installed="2.7.2" location="./tools/composer" copy="true"/>
7+
<phar name="composer" version="^2.7" installed="2.7.3" location="./tools/composer" copy="true"/>
88
</phive>

build/scripts/phar-set-timestamps/run.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,40 @@
1010

1111
if (is_string(getenv('SOURCE_DATE_EPOCH'))) {
1212
$epoch = (int) getenv('SOURCE_DATE_EPOCH');
13+
14+
printf(
15+
'Setting timestamp of files in PHAR to %d (based on environment variable SOURCE_DATE_EPOCH)' . PHP_EOL,
16+
$epoch
17+
);
1318
} else {
14-
$epoch = (int) trim(shell_exec('git log -1 --format=%at ' . trim(shell_exec('git describe --abbrev=0'))));
19+
$tag = @shell_exec('git describe --abbrev=0 2>&1');
20+
21+
if (is_string($tag) && strpos($tag, 'fatal') === false) {
22+
$tmp = @shell_exec('git log -1 --format=%at ' . trim($tag) . ' 2>&1');
23+
24+
if (is_string($tag) && is_numeric(trim($tmp))) {
25+
$epoch = (int) trim($tmp);
26+
27+
printf(
28+
'Setting timestamp of files in PHAR to %d (based on when tag %s was created)' . PHP_EOL,
29+
$epoch,
30+
trim($tag)
31+
);
32+
}
33+
34+
unset($tmp);
35+
}
36+
37+
unset($tag);
38+
}
39+
40+
if (!isset($epoch)) {
41+
$epoch = time();
42+
43+
printf(
44+
'Setting timestamp of files in PHAR to %d (based on current time)' . PHP_EOL,
45+
$epoch
46+
);
1547
}
1648

1749
$timestamp = new DateTime;

tools/composer

8.24 KB
Binary file not shown.

0 commit comments

Comments
 (0)