refactor(config): remove runtime config files and centralize route/bootstrap
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user