-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Composer: let mcrypt_compat "provide" mcrypt req #2
Conversation
This really adds a lot of value to this package. Without it, it's possible to work around an |
The problem I have with merging this is that it breaks the unit tests. In particular, I get the following error:
Any ideas as to how I can fix this? |
@terrafrost, I couldn't reproduce your issue. Though I've used PHP 7.1 on Windows for a quick setup. How did you get that error? I also think many could benefit from your compat library, as I mentioned in #13. |
@terrafrost excuse my ignorance 🙇 It seems it's a Composer bug. I did some debugging and confirmed a behavior that has already been mentioned by someone else: I guess Composer should ignore php extensions when looking which package (library) makes which package obsolete. |
There is another option that works reasonably well if you just need to install other Composer libraries that depend on {
"require": {
"phpseclib/mcrypt_compat": "^1.0",
// ...
},
"config": {
"platform": {
"ext-mcrypt": "1.0.0"
}
}
} |
@@ -32,5 +32,8 @@ | |||
}, | |||
"autoload": { | |||
"files": ["lib/mcrypt.php"] | |||
}, | |||
"provide": { | |||
"ext-mcrypt": "*" |
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.
the value should be version, so use 0
or minimum (uppper?) php api you support
the native extension matches PHP_VERSION:
$ php -r '$r = new ReflectionExtension("mcrypt"); var_dump($r->getVersion());'
Command line code:1:
string(6) "7.1.25"
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.
That seemed to do the trick! I went ahead and made it provide 5.6.40 (the last 5.6 version) since mcrypt was removed in 7.0.0. I've gone ahead and made a new release as well.
Thanks!
for travis. add this fragment:
then downstream projects do not need to hack with their composer.json, as that solution is not flexible as composer.json/composer.lock are committed to repo usually, and i have no choice to use real extension, this compat lib or have a failure in dependency resolution. |
here's project that uses ext provide successfully: |
4c97e9b does this. Thanks! |
No description provided.