WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #36335, comment 251


Ignore:
Timestamp:
10/02/2020 02:44:58 AM (5 months ago)
Author:
jqz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36335, comment 251

    v1 v2  
    44
    55To 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
     7PS. 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/directories so that the PHP class file can be easily determined from the class name.