Files
pta/app/autoload.php
Loic Masi 5fbf76868f pour prod
2026-08-07 16:13:43 +02:00

18 lines
382 B
PHP

<?php
declare(strict_types=1);
spl_autoload_register(static function (string $class): void {
$prefix = 'App\\';
if (!str_starts_with($class, $prefix)) {
return;
}
$relativeClass = substr($class, strlen($prefix));
$file = __DIR__ . '/' . str_replace('\\', '/', $relativeClass) . '.php';
if (is_file($file)) {
require_once $file;
}
});