refactor(config): remove runtime config files and centralize route/bootstrap

This commit is contained in:
2026-04-01 20:27:42 +02:00
parent dba589b495
commit 5699bc6c5b
20 changed files with 487 additions and 118 deletions

View File

@@ -22,9 +22,18 @@ class AccessControl
private array $configuredPublicPaths;
private IntendedUrlService $intendedUrlService;
public function __construct(?array $publicPaths = null, ?IntendedUrlService $intendedUrlService = null)
public function __construct(array $publicPaths = [], ?IntendedUrlService $intendedUrlService = null)
{
$this->configuredPublicPaths = $publicPaths ?? (defined('APP_PUBLIC_PATHS') ? APP_PUBLIC_PATHS : []);
$normalizedPaths = [];
foreach ($publicPaths as $path) {
$rawPath = trim((string) $path);
if ($rawPath === '') {
continue;
}
$normalizedPaths[] = $rawPath === '/' ? '/' : trim($rawPath, '/');
}
$this->configuredPublicPaths = array_values(array_unique($normalizedPaths));
$this->intendedUrlService = $intendedUrlService ?? new IntendedUrlService();
}