Files
argus-wp-defence/includes/class-argus-autoloader.php
T
root df0f2fccb8 ARGUS WordPress Defence 1.0.0 — first production release
Automatic WordPress security: local firewall, malware and file-integrity
scanning, vulnerability protection, quarantine, scheduled backups, an
optional page cache, and automatic global threat intelligence.

See README.md for installation, update, and uninstall instructions.
2026-08-09 13:40:16 +00:00

32 lines
608 B
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Argus_Autoloader {
public static function register() {
spl_autoload_register( array( __CLASS__, 'autoload' ) );
}
public static function autoload( $class ) {
if ( 0 !== strpos( $class, 'Argus_' ) ) {
return;
}
$file_slug = strtolower( str_replace( '_', '-', $class ) );
$candidates = array(
ARGUS_WPD_DIR . 'includes/class-' . $file_slug . '.php',
ARGUS_WPD_DIR . 'admin/class-' . $file_slug . '.php',
);
foreach ( $candidates as $path ) {
if ( file_exists( $path ) ) {
require_once $path;
return;
}
}
}
}