Skip to content

Commit

Permalink
Closes #4740
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jul 22, 2021
1 parent 506cde8 commit 4b5756d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 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.19] - 2021-MM-DD

### Changed

* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): The PHPUnit PHAR no longer imports all code units on startup

## [8.5.18] - 2021-07-19

### Fixed
Expand Down Expand Up @@ -155,6 +161,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.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5
[8.5.18]: https://github.com/sebastianbergmann/phpunit/compare/8.5.17...8.5.18
[8.5.17]: https://github.com/sebastianbergmann/phpunit/compare/8.5.16...8.5.17
[8.5.16]: https://github.com/sebastianbergmann/phpunit/compare/8.5.15...8.5.16
Expand Down
3 changes: 0 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,6 @@

<exec executable="${basedir}/tools/phpab" taskname="phpab" failonerror="true">
<arg value="--all" />
<arg value="--static" />
<arg value="--once" />
<arg value="--phar" />
<arg value="--hash" />
<arg value="SHA-1" />
Expand All @@ -394,7 +392,6 @@
<exec executable="${basedir}/tools/phpab" taskname="phpab" failonerror="true">
<arg value="--all" />
<arg value="--nolower" />
<arg value="--static" />
<arg value="--phar" />
<arg value="--hash" />
<arg value="SHA-1" />
Expand Down
20 changes: 18 additions & 2 deletions build/templates/binary-phar-autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,25 @@ unset($options);
define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', __FILE__));
define('__PHPUNIT_PHAR_ROOT__', 'phar://___PHAR___');

Phar::mapPhar('___PHAR___');
spl_autoload_register(
function($class) {
static $classes = null;

if ($classes === null) {
$classes = [
___CLASSLIST___
];
}

if (isset($classes[$class])) {
require 'phar://___PHAR___' . $classes[$class];
}
},
___EXCEPTION___,
___PREPEND___
);

___FILELIST___
Phar::mapPhar('___PHAR___');

if ($execute) {
if (isset($printManifest)) {
Expand Down
20 changes: 18 additions & 2 deletions build/templates/library-phar-autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@
define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', __FILE__));
define('__PHPUNIT_PHAR_ROOT__', 'phar://___PHAR___');

Phar::mapPhar('___PHAR___');
spl_autoload_register(
function($class) {
static $classes = null;

if ($classes === null) {
$classes = [
___CLASSLIST___
];
}

___FILELIST___
if (isset($classes[$class])) {
require 'phar://___PHAR___' . $classes[$class];
}
},
___EXCEPTION___,
___PREPEND___
);

Phar::mapPhar('___PHAR___');

__HALT_COMPILER();

0 comments on commit 4b5756d

Please sign in to comment.