diff --git a/ChangeLog-8.5.md b/ChangeLog-8.5.md index a63e456716c..b919c285d05 100644 --- a/ChangeLog-8.5.md +++ b/ChangeLog-8.5.md @@ -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 @@ -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 diff --git a/build.xml b/build.xml index 028527645c9..973f2b05fe1 100644 --- a/build.xml +++ b/build.xml @@ -376,8 +376,6 @@ - - @@ -394,7 +392,6 @@ - diff --git a/build/templates/binary-phar-autoload.php.in b/build/templates/binary-phar-autoload.php.in index afac30ff843..cadc6c51a77 100644 --- a/build/templates/binary-phar-autoload.php.in +++ b/build/templates/binary-phar-autoload.php.in @@ -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)) { diff --git a/build/templates/library-phar-autoload.php.in b/build/templates/library-phar-autoload.php.in index e478c268a62..55e1033a675 100644 --- a/build/templates/library-phar-autoload.php.in +++ b/build/templates/library-phar-autoload.php.in @@ -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();