docs: README, OrbStack notes, autoload fallback for deploys without composer

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-11 14:49:39 +02:00
co-authored by Claude Fable 5.1
parent e971163f71
commit dc8cbee8da
6 changed files with 192 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
/**
* Autoloader: Composer als die er is (nodig voor PHPUnit), anders een minimale PSR-4-lader voor src/.
* Zo werkt een deploy ook zonder `composer install`; er zijn immers geen runtime-dependencies.
*/
$composer = dirname(__DIR__) . '/vendor/autoload.php';
if (is_file($composer)) {
require $composer;
return;
}
spl_autoload_register(static function (string $class): void {
$prefix = 'Weerscherm\\';
if (!str_starts_with($class, $prefix)) {
return;
}
$file = __DIR__ . '/' . str_replace('\\', '/', substr($class, strlen($prefix))) . '.php';
if (is_file($file)) {
require $file;
}
});