-
-
Notifications
You must be signed in to change notification settings - Fork 43
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 2 support #47
Comments
Thank you for looking at the code and providing these upgrade hints, Jordi! ❤️
Whoaa.. this is new! Finally, we can reach the inner download loop.
Yes, that's way cleaner and also easy to add. TY for the suggestion. |
Hey guys Is there any plan from your side to release a new version here based on the fix above? |
- stop testing on PHP5 - raise PHPUnit to "^8" (support for PHP 7.1-7.4) - migrate to PHPUnit 6+ (\PHPUnit\Framework\TestCase + setUp():void) - updated Changelog + Readme section on how to require a specific phantomjs version
Composer 2 support landed. I removed the direct mapping of package version to phantomjs version. |
As composer 2 is coming, it would be good to support it here.
From looking at your code, IMO the best way would be to tag a new release 2.0, which supports Composer 1, and 2 together. You can check
if (defined('Composer\Composer::RUNTIME_API_VERSION') && version_compare(Composer\Composer::RUNTIME_API_VERSION, '2.0', '>=')) { ..composer2 behavior .. } else { composer 1..}
For v2, you can not just call download as in https://github.com/jakoch/phantomjs-installer/blob/master/src/PhantomInstaller/Installer.php#L190 - that will not do what you want anymore, and it uses async code which is rather messy to tap into like that.
You should instead do this:
As an aside, I wonder if it wouldn't be better to let users specify the version they want to install in the root package's extra (like you have cdnurl option right now), instead of having a direct mapping of package version to phantomjs version..
The text was updated successfully, but these errors were encountered: