Initial commit: Hermes AI Bridge WordPress plugin for cPanel agent runtime
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace HermesAiBridge;
|
||||
|
||||
defined('ABSPATH') or die();
|
||||
|
||||
class Autoloader {
|
||||
public static function register() {
|
||||
spl_autoload_register([__CLASS__, 'autoload']);
|
||||
}
|
||||
|
||||
private static function autoload($class) {
|
||||
$prefix = 'HermesAiBridge\\';
|
||||
$len = strlen($prefix);
|
||||
if (strncmp($prefix, $class, $len) !== 0) return;
|
||||
|
||||
$relative_class = substr($class, $len);
|
||||
$file = HERMES_AI_BRIDGE_DIR . 'includes/' . strtolower(str_replace('_', '-', $relative_class)) . '.php';
|
||||
|
||||
if (file_exists($file)) require_once $file;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user