-
Notifications
You must be signed in to change notification settings - Fork 12
Use lorenzo/pinky, breaks compatibility with PHP < 5.6 #3
Conversation
Hey, thanks for this PR. Have a look at https://github.com/gremo/ZurbInkBundle/blob/master/src/Resources/config/services.xml service Pinky should be created and injected into |
Oh, I noticed that I forgot to remove the old Inky service from the class, I will change that. As for injecting Pinky, since it's not a class but a namespace, I don't think this is possible or even a good practice, or I am missing something ? |
Well about the injection, i seriously don't know. Let me think about it. What about the PHP version bump in composer? Maybe my understandings of composer/semver are low, but this project still require PHP > 5.3 and not PHP 5.6... am I right? That is, we are not directly using features from PHP 5.6, it's only Pinky requiring that version. |
For reference : https://github.com/lorenzo/pinky/blob/master/src/pinky.php As for the version bump, I followed Pinky's composer.json blindly. There must be a reason that it's PHP 5.6 there. If not, then yes, we could totally lower the requirement — though I'm not sure if composer would choke when installing if you're on 5.3 and it finds a requirement for 5.6 in a sub-vendor composer.json ... |
For the version bump, I don't think we should consider all the dependencies listed in I think composer is smart to figure it out, letting you to install the latest version of this package (not including pinky) if you are running PHP < 5.6. |
I'm afraid we need the version bump. It gives a better indication on what is the minimum required for the bundle (instead of finding out when |
composer will find the previous release (that will still have |
I think the problem here is the |
This is just a setting to emulate running 5.3.2 instead of my actual PHP that is 7.2, but it's equivalent to running 5.3.2 from a composer point of view |
@tchapi yes I know.. but isn't the right behavior? You are faking 5.3.2 and try to install this package. Should install 3.0.1 assuming the requirement is "^3.0.0" It should work. When we bump the version (say) to 3.1.0, the new requirement for Pinky should be considered and composer should stick with 3.0.1. |
This is my understanding of the composer resolver (but I clearly might be wrong):
Then when composer will try to find the adequate package for some guy (on PHP 5.3.2) installing the library, it will look at these releases and will find that both require a minimum of 5.3.2, so it will pick the latest one, which will fail. That is to say, when choosing the release, composer only looks at the root If we bump :
When composer installing (the same guy with the same PHP version of 5.3.2), composer will discard the 3.1.0 release since it's not compatible and will successfully install 3.0.1. Again, this is my understanding that composer will not resolve all dependencies of all packages (and their dependencies, and their dependencies, etc) before choosing which version to install. @damienalexandre long time no talk but I think you're the perfect expert to enlighten us on the subject ;) |
@tchapi I see.... good to know. Can we easly test this beahviour with your fork? Maybe you can push a new tag 3.1.0 and see what happens... |
Why is the break with PHP version so bad? PHP versions < 5.6 are not supported PHP versions anyway. Of course, this does not mean that this bundle should not support PHP < 5.6. Currently, it does, which is good, of course. |
@BernhardWebstudio I agree with you and that's the way we should follow. I'm only concerned about the following: raising the PHP version requirements to 5.6 even if it's not true in the sense that the code I wrote I've no much time at the moment, can you confirm what @tchapi is saying about the PHP version requirement in composer.json? |
Yes, I confirm that the change in minimum PHP version in this PR is for this repositorys benefit. It does not actually matter, but makes it easier (and presumably faster) for composer to determine the correct versions of dependencies. |
Hello, is this pr soon accepted ? Thanks |
@ChoppyThing done! Cheers! |
Thanks a lit @gremo ! 🍾 |
Thanks a lot for merging and tagging, @gremo ! |
Following #1 and @solverat's code :