[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal

WordPress Trac noreply at wordpress.org
Thu Apr 28 00:34:09 UTC 2016


#36335: Next generation: core autoloader proposal
-----------------------------+-----------------------------
 Reporter:  dnaber-de        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+-----------------------------

Comment (by F J Kaiser):

 Replying to [comment:10 giuseppe.mazzapica]:
 > An example (among literally dozens) the class `WP_MatchesMapRegex` is
 located in a file named `class-wp.php` that is so named because ''also''
 contains the class `WP`.
 >
 > Not to talk about some classes that are placed pretty much arbitrarily:
 `wpdb` class is in `wp-db.php` and `WP_Query` class is in `query.php`.

 Replying to [comment:8 rmccue]:
 > I think a staged approach to this is the best way. Firstly, let's make
 every class that's not always loaded (wp-admin, etc) loadable via
 autoloading. This is probably a large task in itself, as we need to switch
 to one-class-per-file with predictable file naming.

 Whatever solution there could be, the list of class and file names imo is
 priority 1. From there, further steps can be taken. I suggest strongly to
 break this task in multiple tickets and proceed from there on.

 As I have done an throughout analysis (not by hand) of all classes, etc.
 in core (4.4), I can provide '''the base for step one'''


 {{{
             Class                                  Matches REF        EXT
 min/Max PHP min/Max PHP all
 -----------------------------------------------------------------------------------------
             AMFReader                              1       user
 5.0.0
             AMFStream                              1       user
 5.0.0
             AVCSequenceParameterSetReader          1       user
 5.0.0
             AtomEntry                              1       user
 4.0.0
             AtomFeed                               1       user
 4.0.0
             AtomParser                                     user
 5.0.0
             Automatic_Upgrader_Skin                5       user
 5.0.0
             Bulk_Plugin_Upgrader_Skin              1       user
 5.0.0
             Bulk_Theme_Upgrader_Skin               1       user
 5.0.0
             Bulk_Upgrader_Skin                     2       user
 5.0.0
          CU COM                                    3       user
 4.0.0
             Core_Upgrader                          4       user
 5.0.0
             Custom_Background                      1       user
 5.0.0
             Custom_Image_Header                    1       user
 5.0.0
          C  DOMDocument                            6       dom
 5.0.0       5.0.0
             DOMText                                2       dom
 5.0.0       5.0.0
             DOMXPath                               6       dom
 5.0.0       5.0.0
             DateTimeZone                           5       date
 5.2.0       5.2.0
          C  Error                                  8       user
 4.0.0       5.1.0
             Exception                              41      Core
 5.1.0       5.1.0
          C  Featured_Content                       1       user
 4.0.0       5.1.0
             File_Upload_Upgrader                   2       user
 5.0.0
             Gettext_Translations                   2       user
 5.0.0
             IXR_Base64                             1       user
 5.0.0
             IXR_Client                             3       user
 5.0.0
             IXR_ClientMulticall                            user
 5.0.0
             IXR_Date                               5       user
 5.0.0
             IXR_Error                              214     user
 5.0.0
             IXR_IntrospectionServer                        user
 5.0.0
             IXR_Message                            3       user
 5.0.0
             IXR_Request                            2       user
 5.0.0
             IXR_Server                             2       user
 5.0.0
             IXR_Value                              4       user
 5.0.0
          C  Imagick                                2       imagick
 2.0.0a1     5.1.3
          C  ImagickPixel                           1       imagick
 2.0.0a1     5.1.3
             Language_Pack_Upgrader                 5       user
 5.0.0
             Language_Pack_Upgrader_Skin            2       user
 5.0.0
          C  MO                                     2       user
 5.0.0
             MagpieRSS                              1       user
 5.0.0
             Memcache                               1       memcache   0.2
 4.3.3
          C  NOOP_Translations                      1       user
 5.0.0
             PDO                                    1       PDO
 5.1.0       5.1.0
           U PEAR                                   3       user
 4.0.0
          CU PEAR_Error                             1       user
 4.0.0
             PHPMailer                              1       user
 4.0.0       5.2.0RC1
          C  PO                                     24      user
 5.0.0
          C  POMO_CachedFileReader                  1       user
 5.0.0
          C  POMO_CachedIntFileReader                       user
 5.0.0
          C  POMO_FileReader                        1       user
 5.0.0
          C  POMO_Reader                            3       user
 5.0.0
          C  POMO_StringReader                      1       user
 5.0.0
             POP3                                   1       user
 5.0.0
             PasswordHash                           7       user
 5.0.0
             PclZip                                 165     user
 5.0.0
             Plugin_Installer_Skin                  2       user
 5.0.0
             Plugin_Upgrader                        7       user
 5.0.0
             Plugin_Upgrader_Skin                   1       user
 5.0.0
             RSSCache                               1       user
 5.0.0
             ReflectionClass                        1       Reflection
 5.0.0       5.0.0
             SMTP                                   1       user
 4.0.0       5.1.0
          C  Services_JSON                          6       user
 5.0.0
             Services_JSON_Error                    2       user
 5.0.0
          C  SimplePie                              3       user
 4.0.0       5.3.0
             SimplePie_Author                               user
 5.0.0
             SimplePie_Cache                        3       user
 5.0.0
             SimplePie_Cache_DB                     1       user
 5.0.0
             SimplePie_Cache_File                   1       user
 5.0.0
             SimplePie_Cache_Memcache                       user
 5.0.0
             SimplePie_Cache_MySQL                          user
 4.0.0       5.1.0
             SimplePie_Caption                              user
 5.0.0
             SimplePie_Category                             user
 5.0.0
             SimplePie_Content_Type_Sniffer                 user
 5.0.0
             SimplePie_Copyright                            user
 5.0.0
             SimplePie_Core                                 user
 4.0.0
             SimplePie_Credit                               user
 5.0.0
             SimplePie_Decode_HTML_Entities         1       user
 5.0.0
             SimplePie_Enclosure                            user
 5.0.0
             SimplePie_Exception                    3       user
 4.0.0       5.1.0
             SimplePie_File                         2       user
 5.0.0
             SimplePie_HTTP_Parser                  2       user
 5.0.0
             SimplePie_IRI                          8       user
 5.0.0
             SimplePie_Item                                 user
 4.0.0       5.3.0
             SimplePie_Locator                              user
 5.0.0
             SimplePie_Misc                         28      user
 4.0.0       5.1.0
             SimplePie_Net_IPv6                     2       user
 5.0.0
             SimplePie_Parse_Date                   2       user
 5.0.0
             SimplePie_Parser                               user
 4.0.0       5.1.0
             SimplePie_Rating                               user
 5.0.0
             SimplePie_Registry                     6       user
 5.0.0
             SimplePie_Restriction                  1       user
 5.0.0
             SimplePie_Sanitize                     2       user
 5.0.0
             SimplePie_Source                               user
 5.0.0
             SimplePie_XML_Declaration_Parser               user
 5.0.0
             SimplePie_gzdecode                     1       user
 5.0.0
          C  SimpleXMLElement                       1       SimpleXML
 5.0.1       5.0.1
          C  Snoopy                                         user
 5.0.0
          CU Sodium                                 2       user
 4.0.0
          C  Text_Diff                              6       user
 5.0.0
             Text_Diff_Engine_native                        user
 4.0.0
             Text_Diff_Engine_shell                         user
 4.0.0       4.0.4
             Text_Diff_Engine_string                        user
 4.0.0
             Text_Diff_Engine_xdiff                         user
 4.0.0
             Text_Diff_Op                           4       user
 5.0.0
             Text_Diff_Op_add                       7       user
 5.0.0
             Text_Diff_Op_change                    5       user
 5.0.0
             Text_Diff_Op_copy                      10      user
 5.0.0
             Text_Diff_Op_delete                    7       user
 5.0.0
             Text_Diff_Renderer                     2       user
 5.0.0
             Text_Diff_Renderer_inline              2       user
 4.0.0
             Text_MappedDiff                                user
 5.0.0
             Theme_Installer_Skin                   2       user
 5.0.0
             Theme_Upgrader                         6       user
 5.0.0
             Theme_Upgrader_Skin                    1       user
 5.0.0
          C  Translation_Entry                      6       user
 5.0.0
          C  Translations                           1       user
 5.0.0
             Twenty_Eleven_Ephemera_Widget                  user
 4.0.0       4.3.0
             Twenty_Fourteen_Ephemera_Widget                user
 5.0.0
          C  TypeError                              17      user
 4.0.0       5.1.0
             WP                                     1       user
 4.0.0       5.1.2
             WP_Admin_Bar                                   user
 5.0.0
             WP_Ajax_Response                       15      user
 5.0.0
             WP_Automatic_Updater                   5       user
 5.0.0
             WP_Comment                             4       user
 4.0.0       5.1.0
             WP_Comment_Query                       5       user
 5.0.0
             WP_Comments_List_Table                 1       user
 5.0.0
             WP_Customize_Background_Image_Control  1       user
 5.0.0
             WP_Customize_Background_Image_Setting  1       user
 5.0.0
             WP_Customize_Color_Control             5       user
 5.0.0
             WP_Customize_Control                   12      user
 5.0.0
             WP_Customize_Cropped_Image_Control     1       user
 5.0.0
             WP_Customize_Filter_Setting            2       user
 5.0.0
             WP_Customize_Header_Image_Control      1       user
 5.0.0
             WP_Customize_Header_Image_Setting      1       user
 5.0.0
             WP_Customize_Image_Control             3       user
 5.0.0
             WP_Customize_Manager                   3       user
 4.0.0       5.1.2
             WP_Customize_Media_Control             1       user
 5.0.0
             WP_Customize_Nav_Menu_Auto_Add_Control         user
 5.0.0
             WP_Customize_Nav_Menu_Control                  user
 5.0.0
             WP_Customize_Nav_Menu_Item_Control     1       user
 5.0.0
             WP_Customize_Nav_Menu_Item_Setting     2       user
 4.0.0       5.1.0
             WP_Customize_Nav_Menu_Location_Control 1       user
 5.0.0
             WP_Customize_Nav_Menu_Name_Control             user
 5.0.0
             WP_Customize_Nav_Menu_Section          1       user
 5.0.0
             WP_Customize_Nav_Menu_Setting          2       user
 4.0.0       5.1.0
             WP_Customize_Nav_Menus                 1       user
 5.0.0
             WP_Customize_Nav_Menus_Panel           1       user
 5.0.0
             WP_Customize_New_Menu_Control          1       user
 5.0.0
             WP_Customize_New_Menu_Section          1       user
 5.0.0
             WP_Customize_Panel                     2       user
 5.0.0
             WP_Customize_Section                   5       user
 5.0.0
             WP_Customize_Setting                   5       user
 5.0.0
             WP_Customize_Sidebar_Section           1       user
 5.0.0
             WP_Customize_Site_Icon_Control         1       user
 5.0.0
             WP_Customize_Theme_Control             2       user
 5.0.0
             WP_Customize_Themes_Section            1       user
 5.0.0
             WP_Customize_Upload_Control            1       user
 5.0.0
             WP_Customize_Widgets                   1       user
 4.0.0       5.2.0
             WP_Date_Query                          4       user
 5.0.0
             WP_Dependencies                        2       user
 5.0.0
             WP_Embed                               1       user
 5.0.0
          C  WP_Error                               319     user
 5.0.0
             WP_Feed_Cache                                  user
 5.0.0
             WP_Feed_Cache_Transient                1       user
 5.0.0
             WP_Filesystem_Base                     4       user
 5.0.0
             WP_Filesystem_Direct                           user
 5.0.0
             WP_Filesystem_FTPext                           user
 5.0.0
             WP_Filesystem_SSH2                             user
 5.0.0
             WP_Filesystem_ftpsockets                       user
 5.0.0
           U WP_HTTP                                1       user
 4.0.0
             WP_HTTP_Fsockopen                              user
 5.0.0
             WP_HTTP_IXR_Client                     2       user
 5.0.0
             WP_HTTP_Proxy                          2       user
 5.0.0
             WP_HTTP_Response                       1       user
 5.0.0
           U WP_HTTP_Streams                        1       user
 4.0.0
             WP_Http                                12      user
 5.0.0
             WP_Http_Cookie                         2       user
 5.0.0
             WP_Http_Curl                                   user
 5.0.0
             WP_Http_Encoding                       5       user
 5.0.0
             WP_Http_Streams                                user
 5.0.0
             WP_Image_Editor                        2       user
 5.0.0
             WP_Image_Editor_GD                             user
 5.0.0
             WP_Image_Editor_Imagick                        user
 5.0.0
             WP_Importer                                    user
 5.0.0
             WP_Internal_Pointers                           user
 5.0.0
             WP_Links_List_Table                            user
 5.0.0
             WP_List_Table                          14      user
 5.0.0
             WP_Locale                              7       user
 5.0.0
             WP_MS_Sites_List_Table                         user
 5.0.0
             WP_MS_Themes_List_Table                        user
 4.0.0       5.0.2
             WP_MS_Users_List_Table                         user
 5.0.0
             WP_MatchesMapRegex                     3       user
 5.0.0
             WP_Media_List_Table                            user
 5.0.0
             WP_Meta_Query                          6       user
 5.0.0
             WP_Nav_Menu_Widget                             user
 5.0.0
             WP_Network                             12      user
 5.0.0
             WP_Object_Cache                        1       user
 4.0.0       5.2.0
             WP_Plugin_Install_List_Table                   user
 5.0.0
             WP_Plugins_List_Table                          user
 5.0.0
             WP_Post                                8       user
 5.0.0
             WP_Post_Comments_List_Table                    user
 5.0.0
             WP_Posts_List_Table                            user
 5.0.0
             WP_Press_This                          1       user
 5.0.0
             WP_Query                               15      user
 5.0.0
             WP_REST_Request                        3       user
 4.0.0       5.3.0
             WP_REST_Response                       4       user
 5.0.0
             WP_REST_Server                                 user
 4.0.0       5.1.0
             WP_Rewrite                             1       user
 4.0.0       5.1.0
             WP_Role                                3       user
 5.0.0
             WP_Roles                               3       user
 5.0.0
          C  WP_Screen                              5       user
 5.0.0
             WP_Scripts                             3       user
 5.0.0
             WP_Session_Tokens                      10      user
 5.0.0
             WP_SimplePie_File                              user
 5.0.0
             WP_SimplePie_Sanitize_KSES             1       user
 5.0.0
             WP_Site_Icon                           1       user
 5.0.0
             WP_Styles                              2       user
 5.0.0
             WP_Tax_Query                           2       user
 5.0.0
             WP_Term                                4       user
 5.0.0
             WP_Terms_List_Table                            user
 5.0.0
          C  WP_Text_Diff_Renderer_Table            1       user
 5.0.0
             WP_Text_Diff_Renderer_inline                   user
 5.0.0
             WP_Theme                               17      user
 4.0.0       5.4.0
             WP_Theme_Install_List_Table                    user
 5.0.0
             WP_Themes_List_Table                   1       user
 4.0.0       5.0.2
             WP_Upgrader                            4       user
 5.0.0
             WP_Upgrader_Skin                       8       user
 5.0.0
             WP_User                                17      user
 5.0.0
             WP_User_Meta_Session_Tokens                    user
 5.0.0
             WP_User_Query                          3       user
 5.0.0
          C  WP_User_Search                                 user
 5.0.0
             WP_Users_List_Table                            user
 5.0.0
             WP_Widget                              16      user
 5.0.0
             WP_Widget_Archives                             user
 5.0.0
             WP_Widget_Area_Customize_Control       1       user
 5.0.0
             WP_Widget_Calendar                             user
 5.0.0
             WP_Widget_Categories                           user
 5.0.0
             WP_Widget_Factory                      1       user
 5.0.0
             WP_Widget_Form_Customize_Control       1       user
 5.0.0
             WP_Widget_Links                                user
 5.0.0
             WP_Widget_Meta                                 user
 5.0.0
             WP_Widget_Pages                                user
 5.0.0
             WP_Widget_RSS                                  user
 5.0.0
             WP_Widget_Recent_Comments                      user
 5.0.0
             WP_Widget_Recent_Posts                         user
 5.0.0
             WP_Widget_Search                               user
 5.0.0
             WP_Widget_Tag_Cloud                            user
 5.0.0
             WP_Widget_Text                                 user
 5.0.0
             WP_oEmbed                              3       user
 4.0.0       5.1.0
             WP_oEmbed_Controller                   1       user
 5.0.0
             Walker                                 7       user
 5.0.0
             Walker_Category                        1       user
 5.0.0
             Walker_CategoryDropdown                1       user
 5.0.0
             Walker_Category_Checklist              1       user
 5.0.0
             Walker_Comment                         2       user
 5.0.0
             Walker_Nav_Menu                        3       user
 5.0.0
             Walker_Nav_Menu_Checklist              3       user
 5.0.0
             Walker_Nav_Menu_Edit                           user
 5.0.0
             Walker_Page                            1       user
 5.0.0
             Walker_PageDropdown                    1       user
 5.0.0
             XMLReader                              1       xmlreader
 5.0.0       5.0.0
          C  ZipArchive                             1       zip
 1.6.0       5.2.0
             _WP_Dependency                         1       user
 5.0.0
          C  _WP_Editors                            4       user
 4.0.0       5.5.0
             _WP_List_Table_Compat                  2       user
 5.0.0
             ftp                                    1       user
 4.0.0       4.3.0
             ftp_base                               2       user
 4.0.0       4.0.4
          C  getID3                                 18      user
 5.0.0
             getid3_ac3                             2       user
 5.0.0
             getid3_apetag                          1       user
 5.0.0
             getid3_asf                                     user
 4.0.0       5.3.0
             getid3_dts                             1       user
 5.0.0
             getid3_exception                       8       user
 4.0.0       5.1.0
             getid3_flac                            2       user
 5.0.0
             getid3_flv                                     user
 5.0.0
             getid3_handler                         14      user
 5.0.0       5.1.0
             getid3_id3v1                           2       user
 5.0.0
             getid3_id3v2                           3       user
 5.0.0
             getid3_lib                             901     user
 4.0.0       5.1.0
             getid3_lyrics3                                 user
 5.0.0
             getid3_matroska                                user
 4.0.0       5.1.0
             getid3_mp3                             6       user
 5.0.0
           U getid3_mpeg                            1       user
 4.0.0
             getid3_ogg                             2       user
 5.0.0
             getid3_quicktime                               user
 5.0.0
             getid3_riff                            8       user
 4.0.0       5.1.0
          CU idna_convert                           2       user
 4.0.0
             parent                                 102     Core
 5.0.0       5.0.0
          CU pear                                           user
 4.0.0
             phpmailerException                     25      user
 4.0.0       5.1.0
             self                                   263     Core
 5.0.0       5.0.0
             stdClass                               34      Core
 4.0.0       4.0.0
          C  wp_atom_server                                 user
 5.0.0
             wp_xmlrpc_server                               user
 4.0.0       5.1.0
             wpdb                                   1       user
 5.0.0
 -----------------------------------------------------------------------------------------
             Total [294]
 5.2.0       5.4.0
 }}}

 When you read until here: you can close your mouth now.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36335#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list