Is it possible to check for the specific features required for drush (e.g., JSON), rather than checking the PHP version number? The 2.0 release of Drush does an explicit check for PHP version number, and exits if it is below 5.2. I used prerelease versions of drush 2.0 very happily on my RHEL servers running PHP 5.1.6. To make it work, I had to explicitly install and activate JSON.
Unfortunately it is not an option for RHEL users to upgrade PHP, as RedHat does not offer a 5.2.x version of PHP (and the reason people pay RedHat so much money is for the support - which is invalidated if you install non-RedHat versions of packages).
If the 5.2 requirement is for JSON only, it would be better to check for JSON support rather than checking just the PHP version number.
Comment | File | Size | Author |
---|---|---|---|
#7 | drush-json.patch | 2.53 KB | seanburlington |
#7 | JSON.php_.txt | 33.22 KB | seanburlington |
#4 | drush.php_.patch | 932 bytes | seanr |
Comments
Comment #1
jeffschuler+1 for this.
While I appreciate Moshe's point in #479718: Undocumented dependency on php version >= 5.2.4, I'm on the same page, here, having a number of CentOS/RHEL servers that must stick to supported PHP releases...
Comment #2
Owen Barton CreditAttribution: Owen Barton commentedThe previous issue was kind of deconstructed by some unhelpful and unfriendly name calling, but I think it is fair to say that a patch that reliably checks for the specific functionality in the appropriate place in the bootstrap or command, or finds a way to gracefully degrade if possible (as we did in the previous patch) it will certainly be looked at.
Comment #3
tedp CreditAttribution: tedp commentedI hope this patch is created. I want to install Drush 2.0 but am stuck with Red Hat support for PHP 5.1.6 since I'm paying for RHEL 5. I'm on Drupal 5.x and am not expecting to upgrade to Drupal 7.x anytime soon, with its dependency on PHP 5.2.
--Ted
Comment #4
seanrThe attached patch replaces the version check with tests for the functions json_decode and json_encode. Tested on my PHP 5.1.6 server with and without json enabled and all appears to function as expected.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedI suspect that we are relying on 5.2 in more places than just JSON. Needs thorough testing.
Comment #6
seanrHas anyone other than me been able to test this? I've been using it successfully on my server and have not run into any problems, but if we can get some more people testing it, we'd have a better shot at finding and working around any other dependencies.
Comment #7
seanburlington CreditAttribution: seanburlington commentedThe patch above applies cleanly and appears to work
However I'm not even in a position to install pecl packages on this server so it doesn't get me very far.
Ironically my site *is already* using JSON - but via a class!
So I've taken the same approach to adapting drush to remove the JSON dependency entirely.
The patch adapts Drush to use the JSON class (also attached) from http://pear.php.net/pepr/pepr-proposal-show.php?id=198
For users who want Drush on RedHat but can't go outside packages or compile stuff this may be a solution
This patch runs cron and update for me but is otherwise untested.
Comment #8
seanburlington CreditAttribution: seanburlington commentedI'm suggesting a slight change of goal here
I think that Drush should work wherever Drupal works.
@Moshe - I agree this needs more testing
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedno progress. 5.1 is even more ancient than when we started this. i don't see this happenning.
Comment #10
seanburlington CreditAttribution: seanburlington commentedHi Moshe,
I understand that PHP 5.1 is old - but it's still the only supported version on RedHat
If you think the patch needs work - can you clarify what work?
Have you found a problem with it?
It works for me
I think it's more useful to leave this issue flagged as needs review to encourage others who need it to try out the patch and report back if it works for them.
Comment #11
moshe weitzman CreditAttribution: moshe weitzman commentedmy problem with the patches is that they only deal with json_encode. but this change implies that we cannot take advantage of other 5.2 features, at least in core drush. and drush plugins tend to follow what drush does so they are affected too.
we already have a tremendous backwards compat burden supporting 3 major versions of drupal. adding backward compat for old php versions is too much for me. php 5.2 was released on 02-Nov-2006.
i'm aware of the redhat problem. 3 years is apparently not enough for them to get onto latest php. thats not our problem.
Comment #12
seanburlington CreditAttribution: seanburlington commentedHi Moshe,
like with IE6 - old versions are our problem - we as developers can't always just say "upgrade" - and be done with it :-)
I can see that you don't want to be held back forever - so how about this...
Why not release a version of Drush that works on PHP 5.1 - maybe using my patches - this branch wouldn't see new development but making it available would still be pretty useful.
As far as I can see all this would need is the creation of a branch and the application of the existing patch.
What do you think?
Comment #13
moshe weitzman CreditAttribution: moshe weitzman commentedI'm still not interested. If one of the other maintainers wants to look after this branch, then thats OK.
Comment #14
seanburlington CreditAttribution: seanburlington commentedHi Moshe
maybe you want to mark this as won't fix ?
I can't see how any level of work or review is going to change anything - so asking for more work or more review seems fairly pointless.
At least a won't fix decision is clear
and then people can make their own decision if they want to use the patch :-)
Comment #15
greg.1.anderson CreditAttribution: greg.1.anderson commentedWhen drush-3.0 stable lands, anarcat is going to continue to maintain the 3.0 branch, while drush-HEAD moves on toward 3.1 and 4.0. It therefore would make sense, I think, for anarcat to decide whether or not to support older versions of php in the maintenance branch.
Anarcat is not yet a maintainer, though, so I cannot assign this issue to him.
Comment #16
moshe weitzman CreditAttribution: moshe weitzman commented