-
Notifications
You must be signed in to change notification settings - Fork 38
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
PHP5.6 #220
PHP5.6 #220
Conversation
…n instead of what is installed on the host computer
👍 |
I'm still confused by the approach of the |
@gRegorLove oh, haven't realized that change. You are right, we should not set the config plattform to php 5.6! Here is a good summary of the param: https://andy-carter.com/blog/composer-php-platform |
So, it has to be set to 5.6, run for composer.lock, then removed. |
@dshanske That sounds good. |
But why has the composer.lock has to be 5.6? If there is a composer.lock, composer uses this file for updates, so it does not help to remove the Plattform from composer.json?!? |
@gRegorLove Should we merge this? |
@dshanske can you explain why it has to be 5.6 in the If it stays like this, it will break the next time someone updates the |
README.md
Outdated
6. Make your changes | ||
7. Add PHPUnit tests for your changes, either in an existing test file if suitable, or a new one | ||
8. Make sure your tests pass (`composer phpunit`) | ||
9. Go to your fork of the repo on github.com and make a pull request, preferably with a short summary, detailed description and references to issues/parsing specs as appropriate | ||
9. Bask in the warm feeling of having contributed to a piece of free software |
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.
should be "10."
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.
I'd also suggest switching 6 and 7 to encourage TDD.
- Add PHPUnit tests to cover what you want to change, either in an existing test file if suitable, or a new one
- Make your changes
I'm perfectly fine with no longer distributing a composer.lock. But this repo has had one distributed for a while. |
I don't know the side effects / benefits of distributing without the composer.lock, so I lean towards keeping it for now. Since we're supporting PHP5.6 still, my understanding is the composer.lock should only have 5.6-compatible packages. In PHP7 environments, running |
@gRegorLove but does it really work like this? If you run I still vote against an inconsistant state, where the I still do not understand in which case the |
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.
lgtm
@pfefferle Where is the inconsistency? There isn't a config.platform for PHP 5.6 now. |
@gRegorLove it was only removed from the So you might get different results when you run |
I think this will depend on how @dshanske ran the composer install command? Did you use composer’s platform configuration to force 5.6, or did you go with @gRegorLove’s method of using a php56 binary? I do not have php56 handy right now, but building with composer on PHP 7.4.4 the jq '.["platform-overrides"]' composer.lock
# {
# "php": "5.6.1"
# }
rm -rf vendor composer.lock
#
composer config --list | grep 'platform'
#
composer config --global --list | grep 'platform'
#
composer install
# … snip …
jq '.["platform-overrides"]' composer.lock
# null @dshanske could you make sure that your composer config does not have a platform set when running the install that generates the lock file? (You can borrow the lines above.) I may have a go at updating this branch if I can succeed with a PHP 5.6 binary. Though if you want the lock file to have any value at all, I guess we need to use specifically PHP 5.6.0? Since dependencies will have changed (a lot?) between running php-mf2 on 5.6 and 7.4, I do wonder what the value of the lock file is in a project like this. Are we expecting people installing php-mf2 to always run with these dependencies, or are we expecting them to do their own |
Errant thought while looking through some still-open PRs: do we win anything by also bringing #213 in here? By taking the step to PHP 5.6, I believe we can bring PHPUnit up all the way to version 5 (5.7.27 being the latest of that branch, I believe). |
I think there are two options, removing the .lock file or removing the dev/test requirements (and load them directly in the CI tool)?!? |
We may have been going at this wrong. Taking another look at the previously failing Travis logs, like build #246, it seems like that one actually worked. Running The problem was that Travis’ If someone here with more knowledge of Travis would like to comment, that would be much appreciated, but from a quick skim of Job Lifecycle documentation I feel like we should run both --- a/.travis.yml
+++ b/.travis.yml
@@ -16,5 +16,5 @@ matrix:
allow_failures:
- php: nightly
install:
+ - composer update
- $COMPOSER_REQUIRE
-before_script: composer install I think if we do that, then it should not longer matter what version of the lock file we commit to the repo. Not confident enough to make this commit myself, as I feel like I have no idea how our current Travis setup works. As an example I took a look at the one used by the HTML5 parser and it seems way more complete than ours: it runs |
As of my last commit in this branch:
I propose we aim to keep the Composer lock file somewhat in line with what we expect other developers to want to use locally, which I would say is anything that matches current stable PHP. If others are OK with that, I think this branch is now merge-able! 🎉 |
I think that sounds good, @Zegnat. Do we need to include any specific instructions for anyone installing on PHP5.6 or earlier versions of 7? |
That depends whether we think how likely that is to occur. Note that the lock file only applies when you checkout the repository, maybe because you want to work on the parser as a project, and run How likely is it someone will checkout this repository and run just the parser, or just the test, on an older platform? And if that person’s goal is to develop for the older platform, how likely is it they need specific instructions to know to run |
@pfefferle GitHub does not let me re-request a review from you, so I am choosing to tag you instead 😄 Would love to get another opinion on this one if you have the time! |
Aha, I was misunderstanding thinking |
@Zegnat sure, I will have a look later today (sadly, Github only allows to add reviewer that have direct access to the repo) |
I second @gRegorLove, I think it is mergeable now. I was also not aware, that the
Thanks @Zegnat ! |
@pfefferle thanks for giving this another look! I always find it a little silly that GitHub will not let some request a re-review of someone who actually did leave a review, even when they aren’t a repo owner/contributor. Lock files are not considered when a library is used as dependency because all different dependencies’ dependencies are resolved together to make sure there are no clashes. This is always done based on the default version strings from the package file. (Same goes for Node’s I’ll merge this now! 🚀 |
Close #104.
This does things a bit differently than @gRegorLove #219 .