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

Files: 
CommentFileSizeAuthor
#14 features-remove-minimum-php-version-1245620-14.patch1.55 KBmariacha1
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]
#13 false_php_revert.png26.31 KBmariacha1
#13 features-remove-minimum-php-version-1245620-13.patch1.49 KBmariacha1
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]
#12 features-remove-minimum-php-version-1245620-12.patch911 bytesjhedstrom
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]
#10 features-remove-minimum-php-version-1245620-10.patch1.2 KBjhedstrom
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch features-remove-minimum-php-version-1245620-10.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#6 features-remove-php-version-1245620-6.patch1.16 KBmpotter
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch features-remove-php-version-1245620-6.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#5 features-remove-php-version-1245620-5.patch381 bytesmpotter
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

Comments

delta’s picture

Status:Active» Closed (fixed)
adamdicarlo’s picture

Title:Why in feature file .info i got a php = "5.2.4"» Why does php = "5.2.4" get put into features' .info files?
Version:7.x-1.0-beta3» 7.x-1.x-dev
Category:support» bug
Status:Closed (fixed)» Active

I 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....

adamdicarlo’s picture

Component:Documentation» Code
hefox’s picture

Title:Why does php = "5.2.4" get put into features' .info files?» Don't include php = "5.2.4" in features' .info files
mpotter’s picture

Status:Active» Needs review
StatusFileSize
new381 bytes
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

Does this patch do the trick?

mpotter’s picture

StatusFileSize
new1.16 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch features-remove-php-version-1245620-6.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Or even better, as per hefox, only re-export the php property if it's different from DRUPAL_MINIMUM_PHP.

mortona2k’s picture

When 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

mpotter’s picture

Status:Needs review» Needs work

Looks like this needs more work then.

jhedstrom’s picture

Status:Needs work» Needs review

The 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.

jhedstrom’s picture

StatusFileSize
new1.2 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch features-remove-minimum-php-version-1245620-10.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Actually, 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.

lotyrin’s picture

Status:Needs review» Needs work

Unless I'm mistaken, the change to features_export_prepare() is the actual fix, and the change to features_load_feature() is superfluous.

jhedstrom’s picture

Version:7.x-1.x-dev» 7.x-2.x-dev
Status:Needs work» Needs review
StatusFileSize
new911 bytes
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

The change cot features_load_feature was superfluous. Patch re-rolled against 2.x with that in mind.

mariacha1’s picture

Version:7.x-2.x-dev» 7.x-2.0-rc1
StatusFileSize
new1.49 KB
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]
new26.31 KB

There 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.

Line 11 is actually empty

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.

mariacha1’s picture

StatusFileSize
new1.55 KB
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

Dang it! Rolled out the wrong patch. Trying again.

lotyrin’s picture

I 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?

mpotter’s picture

Status:Needs review» Fixed

Committed to 3805bec.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.