<?php
declare(strict_types=1);
$rootVendor = dirname(__DIR__, 3) . '/vendor/autoload.php';
$packageVendor = dirname(__DIR__) . '/vendor/autoload.php';
if (is_file($packageVendor)) {
require $packageVendor;
} elseif (is_file($rootVendor)) {
require $rootVendor;
}
spl_autoload_register(static function (string $class): void {
$prefix = 'GNexus\\GAuth\\';
if (! str_starts_with($class, $prefix)) {
return;
}
$relative = substr($class, strlen($prefix));
$path = dirname(__DIR__) . '/src/' . str_replace('\\', '/', $relative) . '.php';
if (is_file($path)) {
require $path;
}
});