Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
All in the subject i noticed in my info file, i have a line : php = "5.2.4"
my environnement run on php 5.3.5.
Just need to understand the goals of this line. And why "5.2.4".
Thanks
Comments
Comment #1
delta CreditAttribution: delta commentedok i found that : http://drupal.org/node/542202#php
Comment #2
adamdicarlo CreditAttribution: adamdicarlo commentedI think this is a bug; why would it be necessary to declare php = 5.2.4 for D7 features when 5.2.4 is the minimum version acceptable on D7 anyway?
Also, I think this might only happen when updating the feature through drush, but I'm not sure -- I just know that it initially isn't in the .info and later it gets added....
Comment #3
adamdicarlo CreditAttribution: adamdicarlo commentedComment #4
hefox CreditAttribution: hefox commentedComment #5
mpotter CreditAttribution: mpotter commentedDoes this patch do the trick?
Comment #6
mpotter CreditAttribution: mpotter commentedOr even better, as per hefox, only re-export the php property if it's different from DRUPAL_MINIMUM_PHP.
Comment #7
mortona2k CreditAttribution: mortona2k commentedWhen I apply the patch (#6) and update my feature, it still puts PHP 5.2.4 in .info.
EDIT: does it for both drush and ui update/recreate
Comment #8
mpotter CreditAttribution: mpotter commentedLooks like this needs more work then.
Comment #9
jhedstromThe patch in #6 actually works, it just doesn't work for features that have already been created w/o the feature, since the php version resides in the
system
table for those old features. To test, apply the patch and create a new feature, then run features update via drush, and no more php version in the info file.Comment #10
jhedstromActually, I mis-spoke in #9. Core was adding that php version to the system table, so upon enabling and then exporting, the version re-appeared. The reason for this is that the patch in #6 only sets php version in the
$standard_info
variable, but then the$export
variable is merged in. This updated patch removes the php version from the$export
variable.Comment #11
lotyrin CreditAttribution: lotyrin commentedUnless I'm mistaken, the change to features_export_prepare() is the actual fix, and the change to features_load_feature() is superfluous.
Comment #12
jhedstromThe change cot
features_load_feature
was superfluous. Patch re-rolled against 2.x with that in mind.Comment #13
mariacha1 CreditAttribution: mariacha1 commentedThere is one small bug with this solution, which can be reproduced on the 7.x-2.0-rc1 version:
1) Apply #12 to the 7.x-2.0-rc1 version.
2) Create a simple feature "my_feature".
3) Verify that the my_feature.info file DOES NOT contain the line "php = 5.2.4"
4) Make any change in the database to the feature (add a permission, change a phrase, it does not matter). Verify that running
drush fd
(or visiting the feature page) shows the feature as Overridden.5) View the differences, either by doing
drush fd my_feature
or by visiting "Review Overrides" tab.6) Verify that Features THINKS the .info file contains a reference to php 5.2.4.
Nothing is really harmed by this bug. Reverting the patch does not re-add 5.2.4 to the .info file. It's just a bit obnoxious.
I'm including a patch that seems to fix the false-positive override for me after a cache clear.
Comment #14
mariacha1 CreditAttribution: mariacha1 commentedDang it! Rolled out the wrong patch. Trying again.
Comment #15
lotyrin CreditAttribution: lotyrin commentedI haven't tried it yet, but reading the code, I'd imagine that the change in function features_get_info() should be checking for DRUPAL_MINIMUM_PHP?
Comment #16
mpotter CreditAttribution: mpotter commentedCommitted to 3805bec.