Skip to content

Complete the list of required PHP extensions in composer.json #413

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
],
"require": {
"php": ">=5.4",
"ext-hash": "*",
"ext-json": "*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you experience an error attempting to use the library in a PHP environment where these modules were not loaded? I'm on the fence about how useful this is, as they are both listed as "bundled and compiled into PHP by default" in the PHP.net documentation.

If we do add this, I'd also be inclined to use actual version checks instead of "*". Based on php/php-src@18180bb#diff-17d725bdd470d96051461b6bf27dc116, the ext-json version does appear to be incremented in a semver-like fashion as its API changes with each PHP version. Unfortunately, that isn't the case for ext-hash, which reports "1.0" in PHP versions going back to 5.4 (oldest I tested). That is despite the introduction of new methods in later PHP versions (e.g. hash_equals()) that should entail a minor version bump.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not experience this kind of error but I thought it was a good addition after reading this blog post.

Concerning the version number, I quote the Composer documentation:

ext-<name> allows you to require PHP extensions (includes core extensions). Versioning can be quite inconsistent here, so it's often a good idea to just set the constraint to *

"ext-mongodb": "^1.3.0"
},
"require-dev": {
Expand Down