New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simple-phpunit requires the zip extension #21303
Conversation
👍 |
@@ -43,6 +43,9 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ | |||
@unlink("$PHPUNIT_VERSION.zip"); | |||
passthru("wget https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip"); | |||
} | |||
if (!class_exists('ZipArchive')) { | |||
throw new \Exception('simple-phpunit requires the PHP extension for zip support to be installed and enabled in order to download the right version of phpunit'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal for a slightly different error message:
simple-phpunit requires the "zip" PHP extension to be installed and enabled in order to uncompress the downloaded PHPUnit packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, thats better. updated
e87f53e
to
d651051
Compare
@@ -43,6 +43,9 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ | |||
@unlink("$PHPUNIT_VERSION.zip"); | |||
passthru("wget https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip"); | |||
} | |||
if (!class_exists('ZipArchive')) { | |||
throw new \Exception('simple-phpunit requires the "zip" PHP extension to be installed and enabled in order to uncompress the downloaded PHPUnit packages'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually terminate exception messages with a dot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, fixed.
👍 |
d651051
to
6628e76
Compare
👍 |
1 similar comment
👍 |
Thank you @dbu. |
This PR was merged into the 3.2 branch. Discussion ---------- simple-phpunit requires the zip extension without the zip extension enabled, i get `PHP Fatal error: Uncaught Error: Class 'ZipArchive' not found in .../vendor/bin/simple-phpunit:46` | Q | A | ------------- | --- | Branch? | 3.2 (first version containing the script) | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21060 | License | MIT | Doc PR | - Commits ------- 6628e76 simple-phpunit requires the zip extension
without the zip extension enabled, i get
PHP Fatal error: Uncaught Error: Class 'ZipArchive' not found in .../vendor/bin/simple-phpunit:46