Download the PHP package moonwalkingbits/wordpress-autoloader without Composer
On this page you can find all versions of the php package moonwalkingbits/wordpress-autoloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moonwalkingbits/wordpress-autoloader
More information about moonwalkingbits/wordpress-autoloader
Files in moonwalkingbits/wordpress-autoloader
Package wordpress-autoloader
Short Description A class loader for the WordPress coding standards.
License GPL-3.0-or-later
Informations about the package wordpress-autoloader
WordPress Autoloader
A class loader for the WordPress coding standards.
When taking the object oriented approach to developing in PHP, autoloading can get rid of all the include/require statements in your code. Instead of manually including the file before you use the class, or having to check if the class is available you just use it. If it is not yet included it will be automatically included by the class loader.
The only class file you need to include is the autoloader. Or if you use this
library as a composer package it is enough to include composer's autoload.php
.
After you've set it up it will take care of the rest of the includes.
After this setup any class in the Namespace
namespace that resides in the
registered namespace directory can be used directly without any include/require
statements.
Nested namespaces
The autoloader will resolve any classes with nested namespace as long as the directory structure follows the namespace path:
Given the above example the class Namespace\Nested\Test_Class
will be loaded
correctly.
Classes without namespace
To load classes that do not use any namespace just register the mapping with an empty namespace:
License
Autoloader is released under the GPL license.