Commit Graph

3 Commits

Author SHA1 Message Date
Scott Taylor 6a529648cf 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.

Built from https://develop.svn.wordpress.org/trunk@38399


git-svn-id: http://core.svn.wordpress.org/trunk@38340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 09:15:29 +00:00
Scott Taylor e05a033bcb Bootstrap: exclude more files from the `autoloader.classmap` in `composer.json`.
See #36335.

Built from https://develop.svn.wordpress.org/trunk@38395


git-svn-id: http://core.svn.wordpress.org/trunk@38336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 05:40:29 +00:00
Scott Taylor 599d45019f Bootstrap: add `composer.lock` and `src/wp-vendor` files. Nothing is using this code yet, just going through the motions. Ignore the files in `src/wp-vendor/composer` that will explode in PHP 5.2.
See #36335.

Built from https://develop.svn.wordpress.org/trunk@38394


git-svn-id: http://core.svn.wordpress.org/trunk@38335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 03:49:28 +00:00