Changes between Version 2 and Version 3 of Ticket #36335, comment 251
- Timestamp:
- 10/02/2020 02:46:30 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36335, comment 251
v2 v3 5 5 To begin with, just moving the existing classes into a PSR-0/4 compliant directory structure and having an autoloader for them would be a great step forwards. It would not require introducing namespaces or using Composer. The classes already seem to have PSR-0/4-compliant names, just not filenames. 6 6 7 PS. Some previous discussion seems to be conflating a classmap with an autoloader. An autoloader requires no code generation, it is simply a function that says "Is the class you want one that begins `WP_` (or `WP\`)? If so, here it is." But to avoid requiring a classmap (and associated code generation) would require consistency in naming conventions for files/directoriesso that the PHP class file can be easily determined from the class name.7 PS. Some previous discussion seems to be conflating a classmap with an autoloader. An autoloader requires no code generation, it is simply a function that says "Is the class you want one that begins `WP_` (or `WP\`)? If so, here it is." But avoiding requiring a classmap (and associated code generation) would need consistency in naming conventions for files/directories (be that PSR-0/4 or whatever) so that the PHP class file can be easily determined from the class name.