<?php

defined('ABSPATH') || exit;

spl_autoload_register(static function (string $class) : void {
    $prefix = 'APD\\';
    if (strpos($class, $prefix) !== 0) {
        return;
    }

    $relative = substr($class, strlen($prefix));
    $path = ASUKA_PRODUCT_DESIGNER_PATH . 'includes/' . str_replace('\\', '/', $relative) . '.php';

    if (file_exists($path)) {
        require_once $path;
    }
});
