Autoload
Overview
Registers a PSR-style autoloader for Spawn classes and abilities.
Behavior
- Loads classes in the
Spawnnamespace. - Routes
SpawnAbilities*toinc/abilities/class-*.php. - Routes other classes to
inc/class-*.php. - Includes a class map entry for
SpawnGoogle_OAuth.
Example
php
spl_autoload_register(
function ( string $class ): void {
if ( strpos( $class, 'Spawn' ) !== 0 ) {
return;
}
}
);