Closed (fixed)
Project:
Backup and Migrate
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jul 2020 at 09:55 UTC
Updated:
22 Jan 2021 at 16:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaUnfortunately I don't have a way of running PHP 5.4 locally..
Comment #3
damienmckennaComment #4
damienmckennaThis will help: https://github.com/drud/ddev-contrib/tree/master/docker-compose-services...
Comment #5
joelpittet@DamienMcKenna, which issues are you running into, link to test failures?
Comment #6
damienmckennahttps://www.drupal.org/pift-ci-job/1766336
The problem is with BmTestUpdate7310.
Comment #7
jeffschulerJust this:
Comment #8
damienmckennaThat's all it was? 🤦♂️
Thanks for finding that, jeffschuler!
Comment #9
tobiasbThe short array syntax is supported since >= 5.4.
Comment #10
damienmckennaSo it seems like there's more to it, because the tests still fail against PHP 5.4.
Comment #11
tobiasbOk phpstorm found the problem. array_column (>=php 5.5) in backup_migrate_update_7310.
Comment #12
solideogloria commentedYou should probably put both changes into a single patch.
Comment #13
tobiasb@solideogloria
There is only one change. The patch for [] -> array() is wrong.
Comment #14
solideogloria commentedAh, okay. The module already is PHP 5.4 and later.
Comment #15
solideogloria commentedComment #16
solideogloria commentedThere should maybe be a space after the semicolon in the anonymous function. Other than that, it looks good to me, since it follows the recommendation from https://www.php.net/manual/en/function.array-column.php#117229
Comment #17
jeffschuler@tobiasb: Drupal 7's requirements still include PHP 5.3 support, so while I admit that that patch is not the solution to this 5.4-related issue, it's still correct and appropriate.
From #2135291: [Policy, no patch] PHP 5.4 short array syntax coding standards for Drupal 8:
"Short array syntax should not be used in Drupal 7.x or 6.x core or contributed modules."
"Please note, short array syntax is unsupported in versions of PHP prior to 5.4. This means that Drupal 7 core and Drupal 7 contributed projects without an explicit PHP 5.4+ requirement must use long array syntax."
I see no explicit PHP 5.4+ requirement for Backup and Migrate.
Comment #18
jeffschulerAh, I stand corrected. Req is not on the module page, README, or issue queue, but in the module's .info file:
Comment #19
damienmckennaThe main reason to require PHP 5.4 is so that we can use traits to greatly simplify the codebase: #2704333: Use Traits to simplify the codebase
There's an awful lot of duplicate code between the destination and source APIs because traits didn't exist in older PHP. With traits we can have one class for handling databases and then import it into the destination and source classes, instead of duplicating code all over the place.
Comment #21
damienmckennaCommitted.
Comment #23
markabur commentedFYI that short array syntax is causing a WSOD for a client of mine who updated to the latest backup_migrate on a PHP 5.3 server. I can fix it, but I thought people here might be interested to know PHP 5.3 is still out there needing to be supported.
Comment #24
solideogloria commentedThis module does not support PHP 5.3 or earlier. The .info file specifies that PHP 5.4 is required.
Also, PHP 7.2 and earlier is not supported by PHP, so anyone using it should work to get to a newer version.