<?php

defined('DOLPHY_PLUGIN') or die('Access Denied!');

spl_autoload_register(function ($className) {
  if (substr($className, 0, DOLPHY_NS_PREFIX_LENGTH) !== DOLPHY_NS_PREFIX) return;

  $classPath = substr($className, DOLPHY_NS_PREFIX_LENGTH);
  $classPath = str_replace('\\', '/', $classPath);

  $fullPath = DOLPHY_PLUGIN_ROOT."/classes/{$classPath}.php";
  if (!is_file($fullPath)) return;

  require $fullPath;
});

