Make WordPress Core


Ignore:
Timestamp:
08/27/2016 09:15:01 AM (8 years ago)
Author:
wonderboymusic
Message:

Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.

  • wp-admin and wp-includes are scanned for classes to autoload
  • Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see composer.json: autoload.exclude-from-classmap
  • wp-vendor/autoload_52.php is included at the top of wp-settings.php - no changes need to be made to unit tests to include the autoloader
  • An avalanche of require() and require_once() calls that loaded class files have been removed from the codebase.

The following files have been added to svn:ignore - they are not 5.2-compatible and fail during pre-commit:

  • src/wp-vendor/autoload.php
  • src/wp-vendor/composer/autoload_real.php
  • src/wp-vendor/composer/autoload_static.php
  • src/wp-vendor/composer/ClassLoader.php

We favor these files instead:

  • src/wp-vendor/autoload_52.php
  • src/wp-vendor/composer/autoload_real_52.php
  • src/wp-vendor/composer/ClassLoader52.php

When new PHP classes are added to the codebase, simply run composer install or composer update from the project root to update the autoloader.

The future is now.

See #36335.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r38242 r38399  
    99 * @since 2.8.0
    1010 */
    11 
    12 /** WP_Upgrader_Skin class */
    13 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';
    14 
    15 /** Plugin_Upgrader_Skin class */
    16 require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';
    17 
    18 /** Theme_Upgrader_Skin class */
    19 require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';
    20 
    21 /** Bulk_Upgrader_Skin class */
    22 require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';
    23 
    24 /** Bulk_Plugin_Upgrader_Skin class */
    25 require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';
    26 
    27 /** Bulk_Theme_Upgrader_Skin class */
    28 require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';
    29 
    30 /** Plugin_Installer_Skin class */
    31 require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';
    32 
    33 /** Theme_Installer_Skin class */
    34 require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';
    35 
    36 /** Language_Pack_Upgrader_Skin class */
    37 require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';
    38 
    39 /** Automatic_Upgrader_Skin class */
    40 require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';
    41 
    42 /** WP_Ajax_Upgrader_Skin class */
    43 require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
    4411
    4512/**
     
    888855
    889856}
    890 
    891 /** Plugin_Upgrader class */
    892 require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';
    893 
    894 /** Theme_Upgrader class */
    895 require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader.php';
    896 
    897 /** Language_Pack_Upgrader class */
    898 require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader.php';
    899 
    900 /** Core_Upgrader class */
    901 require_once ABSPATH . 'wp-admin/includes/class-core-upgrader.php';
    902 
    903 /** File_Upload_Upgrader class */
    904 require_once ABSPATH . 'wp-admin/includes/class-file-upload-upgrader.php';
    905 
    906 /** WP_Automatic_Updater class */
    907 require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
Note: See TracChangeset for help on using the changeset viewer.