The core/scripts/switch-psr4.sh script will stay around for some more time to make the transition for contrib modules easier, but will eventually be removed.
This issue starts as "postponed", meaning that we wait a while before we remove it.
Background: What does the switch-psr4.sh do?
The script in core/scripts/switch-psr4.sh was added in #2083547: PSR-4: Putting it all together to make it easier to migrate core and contrib modules from PSR-0 to PSR-4.
Automatic PSR-0 support for module-provided class files was / will be removed in #2247287: Drop automatic PSR-0 support for modules.
Once this has landed, contrib D8 modules that still use PSR-0 will break and need to migrate to PSR-4 to work again.
Example:
php core/scripts/switch-psr4.sh modules/contrib/commerce
does all the work for the commerce module package (the module and all submodules)
php core/scripts/switch-psr4.sh modules/contrib
migrates all contrib modules at once.
Running the script more than once is ok, and has no negative effect.
Attention: Classes with underscores in the class name (after the last namespace separator) are special, and need some babysitting to migrate to PSR-4.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2277739-5.patch | 8.88 KB | Palashvijay4O |
Comments
Comment #1
xjmComment #2
catchShould be fine to remove now.
Comment #3
dawehnertagging.
Comment #4
Palashvijay4O commentedComment #5
Palashvijay4O commentedPatch .
Comment #6
jorgillo commentedThe patch applies and works successfully. switch-psr4.sh is no longer in the scripts folder after applying the patch.
Comment #7
dawehnerPerfect
Comment #8
alexpottThis issue is a prioritized change (removal of dead code) as per https://www.drupal.org/core/beta-changes and it's benefits outweigh any disruption. Committed c5b2d48 and pushed to 8.0.x. Thanks!