Skip to content

Commit

Permalink
Closes #5577
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 27, 2023
1 parent 6a66322 commit a85aa74
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog-8.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.

## [8.5.35] - 2023-MM-DD

### Added

* [#5577](https://github.com/sebastianbergmann/phpunit/issues/5577): `--composer-lock` CLI option for PHAR binary that displays the `composer.lock` used to build the PHAR

## [8.5.34] - 2023-09-19

### Changed
Expand Down Expand Up @@ -274,6 +280,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside

[8.5.35]: https://github.com/sebastianbergmann/phpunit/compare/8.5.34...8.5
[8.5.34]: https://github.com/sebastianbergmann/phpunit/compare/8.5.33...8.5.34
[8.5.33]: https://github.com/sebastianbergmann/phpunit/compare/8.5.32...8.5.33
[8.5.32]: https://github.com/sebastianbergmann/phpunit/compare/8.5.31...8.5.32
Expand Down
2 changes: 2 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@

<copy file="${basedir}/phpunit.xsd" tofile="${basedir}/build/tmp/phar/phpunit.xsd"/>

<copy file="${basedir}/composer.lock" tofile="${basedir}/build/tmp/phar/composer.lock"/>

<exec executable="${basedir}/build/scripts/phar-manifest.php" failonerror="true">
<arg path="${basedir}/build/tmp/phar/manifest.txt"/>
<arg path="${basedir}/build/tmp/phar/sbom.xml"/>
Expand Down
12 changes: 10 additions & 2 deletions build/templates/binary-phar-autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) {
$execute = false;
}

$options = getopt('', array('prepend:', 'manifest', 'sbom'));
$options = getopt('', array('prepend:', 'composer-lock', 'manifest', 'sbom'));

if (isset($options['prepend'])) {
require $options['prepend'];
}

if (isset($options['manifest'])) {
if (isset($options['composer-lock'])) {
$printComposerLock = true;
} elseif (isset($options['manifest'])) {
$printManifest = true;
} elseif (isset($options['sbom'])) {
$printSbom = true;
Expand Down Expand Up @@ -92,6 +94,12 @@ foreach ([___CLASSLIST___] as $file) {
}

if ($execute) {
if (isset($printComposerLock)) {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/composer.lock');

exit;
}

if (isset($printManifest)) {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');

Expand Down

0 comments on commit a85aa74

Please sign in to comment.