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

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

wants to merge 1 commit into from

Conversation

villfa
Copy link
Contributor

@villfa villfa commented Oct 2, 2017

It may help users to detect problems during the library install.

@@ -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 *

jmikola added a commit that referenced this pull request Oct 26, 2017
@jmikola
Copy link
Member

jmikola commented Oct 26, 2017

Merged in 206ae32. Thanks!

@jmikola jmikola closed this Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants