Fix running huge via php shell

This commit is contained in:
2025-11-26 09:29:35 +01:00
parent cf634bd788
commit 60bd4ae03d
4 changed files with 16 additions and 3 deletions

View File

@@ -11,7 +11,7 @@
// auto-loading the classes (currently only from application/libs) via Composer's PSR-4 auto-loader
// later it might be useful to use a namespace here, but for now let's keep it as simple as possible
require '../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';
// start our application
new Application();

11
public/router.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
if (php_sapi_name() === 'cli-server') {
$filePath = __DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
if (is_file($filePath)) {
return false;
}
}
$_GET['url'] = isset($_SERVER['PATH_INFO']) ? ltrim($_SERVER['PATH_INFO'], '/') : '';
require __DIR__ . '/index.php';