mirror of
https://gh.wpcy.net/https://github.com/aspirepress/aspireupdate.git
synced 2026-07-16 09:46:32 +08:00
* Add Coding Standard. * Add PHPCS cache directory. * Coding Standards: Apply PHPCBF to codebase. * Coding Standards: Add GitHub workflow. --------- Signed-off-by: Alex Sirota <alex@newpathconsulting.com> Co-authored-by: Alex Sirota <alex@newpathconsulting.com>
25 lines
584 B
PHP
25 lines
584 B
PHP
<?php
|
|
/**
|
|
* The Autoloader.
|
|
*
|
|
* @package aspire-update
|
|
*/
|
|
|
|
spl_autoload_register( 'aspire_update_autoloader' );
|
|
|
|
/**
|
|
* The Class Autoloader.
|
|
*
|
|
* @param string $class_name The name of the class to load.
|
|
* @return void
|
|
*/
|
|
function aspire_update_autoloader( $class_name ) {
|
|
if ( false !== strpos( $class_name, 'AspireUpdate\\' ) ) {
|
|
$class_name = strtolower( str_replace( [ 'AspireUpdate\\', '_' ], [ '', '-' ], $class_name ) );
|
|
$file = __DIR__ . DIRECTORY_SEPARATOR . 'class-' . $class_name . '.php';
|
|
|
|
if ( file_exists( $file ) ) {
|
|
require_once $file;
|
|
}
|
|
}
|
|
}
|