-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Autoloading WordPress classes #3470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aristath
wants to merge
239
commits into
WordPress:trunk
Choose a base branch
from
aristath:autoload
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
239 commits
Select commit
Hold shift + click to select a range
5502082
WIP - building the array
aristath fe7b866
Added more files to the array
aristath 9285636
Moved functions
aristath 239cf2d
Moved more functions
aristath 8bf9e63
remove includes/requires for defined files
aristath b0f9ee4
fix wrong paths in array
aristath 90b0bda
fix includes
aristath 2f3e444
We only need to use ABSPATH once
aristath 134431d
define a _wp_autoload_classes function
aristath c29c9ff
WIP - convert autoloader to a basic class
aristath e28468d
Move definition of WPINC and check if it's defined before redefining it
aristath 7141a60
Register autoloaders for 3rd-party libraries
aristath a64cf56
const instead of static vars
aristath 6c0ce24
fix tests
aristath c9b5be7
Only load the autoloader once
aristath 11e0904
meh
aristath 7b45b02
Move WP_Autoload::register() to the file containing the class
aristath ba223ce
Account for classes written with incorrect cases
aristath c25ba52
Simplify the autoloader a bit
aristath fb4191a
Always check for lowercased classnames
aristath 2b7dbdf
Simplify registration for external/bundled libraries
aristath b15d143
fix return type
aristath 3b2bafa
Split method to 2
aristath beffa9a
Update src/wp-includes/class-wp-autoload.php
aristath ea294c2
Use a constant to improve performance
aristath de96b88
fix for the Requests library update
aristath 12e6bee
Add classes in wp-includes/html-api
aristath 9cb2192
use the autoloader in tests files
aristath beb4d91
fix PHP error in tests
aristath e203887
better fix
aristath dc08f22
forgot to push this line
aristath b4b5202
Update src/index.php
aristath a894547
WPINC is now defined
aristath 932362c
class-IXR.php doesn't need to be included anymore
aristath cb902f0
default-widgets.php no longer needed
aristath 7957071
remove more includes
aristath 7240bdb
Add files in wp-includes/Text
aristath ff1e590
autoload class-phpass.php
aristath 0ed392d
autoload class-pop3.php
aristath 3646160
autoload pclzip
aristath 1e5e109
autoload ftp
aristath a5460ba
remove more includes
aristath 1dd88d2
added more classes to the classmap & removed some more includes
aristath 4f513e9
cleanup tests
aristath c8deeed
Deleted this one by mistake
aristath 148a186
revert changes in multisite.xml
aristath 080ecff
use parentheses
aristath 1ffb58c
include autoloader
aristath 165050c
try to autoload SimplePie
aristath 1db08b3
Add SimplePie classes to the classmap
aristath 03cb9b0
remove duplicate
aristath 6e5f9d5
yet another fix for simplepie
aristath db12934
Revert "include autoloader"
aristath b952526
move classes to be alphabetically ordered
aristath 72e7036
resolve conflicts from merge
aristath 7a36f26
Remove duplicate compat.php requirement
aristath aae6d00
performance improvement
aristath 894826a
Add more HTML API classes
aristath 18d137d
remove more hardcoded requires
aristath d2ba016
add another comment for deprecated classes
aristath f5ed732
resolve rebase conflicts
aristath 4d438d3
fix another rebase conflict
aristath 19dbec0
use the WPINC const :shrug:
aristath d7fc1d4
Add classes in the wp-includes/fonts folder
aristath 38ee411
yet another rebase conflict
aristath e96c4c8
fix a couple of tests
aristath dde3bfb
lowercase classnames
aristath 8183289
include the autoloader in tests
aristath b63bc57
fix files load order
aristath c1d66a8
Revert some changes resulting from rebase conflicts
aristath 3a46630
Added 2 new classes to the autoloader (rebase conflict resolution)
aristath aaadf0f
partial revert
aristath 447b983
set_up() no longer needed
aristath 885a92a
remove another set_up() which is no longer needed
aristath 386562c
more cleanup
aristath 802deb6
set_up_before_class no longer necessary
aristath f3c4b56
Merge branch 'trunk' into autoload
aristath c6c190d
cleanup - set_up_before_class no longer necessary
aristath 38b6a53
Merge branch 'trunk' into autoload
aristath 6254961
Merge branch 'trunk' into autoload
aristath 974a979
Merge branch 'trunk' into autoload
aristath f5f4627
Merge branch 'trunk' into autoload
aristath 1b4c44a
Merge branch 'trunk' into autoload
aristath a3e6dd3
Revert changes to class-wp-block-parser.php
aristath f82b6b7
Merge branch 'trunk' into autoload
aristath dd0d90f
Merge branch 'trunk' into autoload
aristath dc6210c
Add new classes to the autoloader
aristath f78565e
Merge branch 'trunk' into autoload
aristath 485a5ca
Merge branch 'trunk' into autoload
aristath a44e76e
Add the `WP_Block_Bindings_Registry` to the autoloader
aristath a8b45ef
Merge branch 'trunk' into autoload
aristath 6317cb7
Merge branch 'trunk' into autoload
aristath 7a4904a
Merge branch 'trunk' into autoload
aristath 553a68c
Merge branch 'trunk' into autoload
aristath d444ae6
Merge branch 'trunk' into autoload
aristath 1bfac8c
Use str_starts_with()
aristath fc1747e
Merge branch 'trunk' into autoload
aristath 4aade49
Use empty() instead of !isset()
aristath be9c6cd
Use require instead of require_once where possible
aristath bd5bb87
Revert "Use require instead of require_once where possible"
aristath 9e181d6
Add PHPunit tests for the autoloader classmap
aristath bfa7a18
fix lowecase in classMap
aristath 7188eb8
Use `self` instead of `static`
aristath ba7f830
WIP: preload necessary Core classes for Core upgrades
aristath 6ea039d
Update src/wp-admin/includes/update-core.php
aristath 839cded
Update src/wp-admin/includes/update-core.php
aristath 55f6a5b
Update class-wp-autoload.php
aristath 55d2f04
Update class-wp-autoload.php
aristath c8632e9
Merge branch 'trunk' into autoload
aristath dde6611
Move simplepie autoloading to external scripts
aristath 50d4fbd
add avifinfo to the autoloader
aristath f184323
SimplePie should be conditionally loaded
aristath 296e797
Use `require` instead of `require_once` for SimplePie
aristath c0769f4
require_once will be better than a static var
aristath 6baf195
Update src/wp-includes/class-wp-autoload.php
aristath cf7813c
Update src/wp-includes/class-wp-autoload.php
aristath e0ab4ff
Update src/wp-includes/class-wp-autoload.php
aristath 044d2a2
Update src/wp-includes/class-wp-autoload.php
aristath 39ddcd4
Update src/wp-includes/class-wp-autoload.php
aristath e75e265
Update src/wp-includes/class-wp-autoload.php
aristath 5c806e0
Merge branch 'trunk' into autoload
aristath f0106f3
Add new classes to the autoloader
aristath 4d1a977
Revert previous change
aristath 550bc5e
Add back the type
aristath d3e8303
Merge branch 'trunk' into autoload
aristath 028d9a1
Merge branch 'trunk' into autoload
aristath 7fa3a8f
Add new classes to the autoloader
aristath cbc39c5
Merge branch 'trunk' into autoload
aristath c601018
Merge branch 'trunk' into autoload
aristath cc4d72e
Merge branch 'trunk' into autoload
aristath 9b81b58
Merge branch 'trunk' into autoload
aristath f98b101
no need to require the class
aristath 96b08cf
Merge branch 'trunk' into autoload
aristath cbb61c1
Merge branch 'trunk' into autoload
aristath f4aa7b4
Merge branch 'trunk' into autoload
aristath e503d43
Merge branch 'trunk' into autoload
aristath a44145f
Merge branch 'trunk' into autoload
aristath 992086a
Merge branch 'trunk' into autoload
aristath aaba7b5
Merge branch 'trunk' into autoload
aristath e5e94d1
Merge branch 'trunk' into autoload
aristath b0620d3
Merge branch 'trunk' into autoload
aristath 2311749
Merge branch 'trunk' into autoload
aristath a64d90a
Use data providers for the PHPUnit tests
aristath 8ea4dad
Merge branch 'trunk' into autoload
aristath d364fc0
Merge branch 'trunk' into autoload
aristath 1645848
Merge branch 'trunk' into autoload
aristath 393acc5
Add a check for overriden Core classes
aristath 59d76c0
Merge branch 'trunk' into autoload
aristath 8cc3731
Merge branch 'trunk' into autoload
aristath df81cf6
Merge branch 'trunk' into autoload
aristath e7f21cb
Merge branch 'trunk' into autoload
aristath ca99575
Merge branch 'trunk' into autoload
aristath 5d10ef5
Merge branch 'trunk' into autoload
aristath 5aaf8cc
Merge branch 'trunk' into autoload
aristath 32f7c7c
Merge branch 'trunk' into autoload
aristath 3f38052
Merge branch 'trunk' into autoload
aristath 25851ef
Merge branch 'trunk' into autoload
aristath 59e878e
Merge branch 'trunk' into autoload
aristath 8a7f037
Merge branch 'trunk' into autoload
aristath 4df7a9e
Merge branch 'trunk' into autoload
aristath a4276a7
Merge branch 'trunk' into autoload
aristath c14af69
Merge branch 'trunk' into autoload
aristath 67badb6
Merge branch 'trunk' into autoload
aristath fea3685
Merge branch 'trunk' into autoload
aristath 5961c64
Merge branch 'trunk' into autoload
aristath 6e5df39
Merge branch 'trunk' into autoload
aristath 80bf9f2
Merge branch 'trunk' into autoload
aristath 53b5f7b
Merge branch 'trunk' into autoload
aristath ebaf97f
Merge branch 'trunk' into autoload
aristath 0a6687b
Merge branch 'trunk' into autoload
aristath 8855e6d
Merge branch 'trunk' into autoload
aristath d078a48
Merge branch 'trunk' into autoload
aristath 982f563
Merge branch 'trunk' into autoload
aristath 6c57ef8
Merge branch 'trunk' into autoload
aristath 6020065
Merge branch 'trunk' into autoload
aristath 668a7af
Merge branch 'trunk' into autoload
aristath 5ac6b6d
remove another require_once call
aristath d2b56dd
Merge branch 'trunk' into autoload
aristath 4c1d503
Merge branch 'trunk' into autoload
aristath 8fbc046
Merge branch 'trunk' into autoload
aristath 72d2371
Merge branch 'trunk' into autoload
aristath cf355f0
Merge branch 'trunk' into autoload
aristath 87fb7b6
Merge branch 'trunk' into autoload
aristath 6fee23f
Merge branch 'trunk' into autoload
aristath 8bfc64e
Merge branch 'trunk' into autoload
aristath 4694360
Update src/wp-admin/includes/class-wp-site-health.php
aristath 536d703
Update src/index.php
aristath 14843e7
Merge branch 'trunk' into autoload
aristath fbc90ef
Add comment in plugin.php explaining the inclusion of the autoloader
aristath f8d0bf8
Update src/wp-includes/class-wp-autoload.php
aristath 88bed17
Update src/wp-includes/class-wp-autoload.php
aristath deaae87
Update src/wp-includes/class-wp-autoload.php
aristath 3c2ad1d
Update src/wp-admin/includes/class-wp-site-health.php
aristath 31b7939
Update src/wp-admin/includes/update-core.php
aristath bed770e
Update src/wp-admin/includes/class-wp-site-health.php
aristath 85a3df5
Typo (overriden -> overridden)
aristath 829dd9b
Merge branch 'trunk' into autoload
aristath 9d3ed0a
Test that `class-*` files exist in the classMap. Props @peterwilsoncc
aristath a9598ad
Update src/wp-settings.php
aristath e90d3a1
Update src/wp-includes/plugin.php
aristath 73fe7e7
Cleanup
aristath 5168218
Nitpick
aristath 54ac453
Improve the tests
aristath bdbbabc
Improve data providers in tests
aristath cd079bd
Update tests/phpunit/tests/autoloader-classmap.php
aristath 3ff323f
Fix docs language
aristath 82c8531
Update src/wp-includes/class-wp-autoload.php
aristath 6808f2b
Improve docs language
aristath 76293de
Add `since` in class members
aristath 262b110
Update src/wp-admin/includes/class-wp-site-health.php
aristath 4c07440
Add missing `tr` closing tag
aristath 040e3f2
Merge branch 'autoload' of https://github.com/aristath/wordpress-deve…
aristath c663dff
Merge branch 'trunk' into autoload
aristath a53256c
Update src/wp-admin/includes/class-wp-site-health.php
aristath dad3023
Update src/wp-includes/class-wp-autoload.php
aristath 656690b
Fix comment styles
aristath 8b741ce
Remove `return void` annotations
aristath e28567e
Fix comment styles
aristath 0934844
Method doesn't need to be static
aristath 3b7ca69
Add @covers annotation
aristath 282387b
Remove duplicate check
aristath 0372798
Use WP_INC
aristath 2f0b1f7
Merge branch 'trunk' into autoload
aristath b63ce76
a bit more verbose
aristath 5ca7e36
Use WP_INC again :shrug:
aristath 811470d
Merge branch 'trunk' into autoload
aristath 2bbc328
Merge branch 'trunk' into autoload
aristath 16fe142
Merge branch 'trunk' into autoload
aristath eec637b
Merge branch 'trunk' into autoload
aristath fa69f69
Merge branch 'trunk' into autoload
aristath f85236d
Merge branch 'trunk' into autoload
aristath c014fd6
Add WP_HTML_Doctype_Info class to the autoloader
aristath 7d97e22
Merge branch 'trunk' into autoload
aristath 423eb74
Merge branch 'trunk' into autoload
aristath 855ace3
Merge branch 'trunk' into autoload
aristath 5ac7dfc
Merge branch 'trunk' into autoload
aristath 9356648
Merge branch 'trunk' into autoload
aristath 7ab16a4
Add WP_Block_Templates_Registry to autoloader
aristath 1a326a9
Merge branch 'trunk' into autoload
aristath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.