refactor(config): remove runtime config files and centralize route/bootstrap
This commit is contained in:
@@ -11,6 +11,8 @@ use MintyPHP\Http\IntendedUrlService;
|
||||
use MintyPHP\Http\LocaleResolver;
|
||||
use MintyPHP\Http\RequestContext;
|
||||
use MintyPHP\Http\Request;
|
||||
use MintyPHP\Http\RouteCatalog;
|
||||
use MintyPHP\Http\RouteRegistrar;
|
||||
use MintyPHP\I18n;
|
||||
use MintyPHP\Router;
|
||||
use MintyPHP\App\Module\ModuleRegistry;
|
||||
@@ -55,7 +57,9 @@ if (count($activeModules) > 0 || is_dir($runtimePageRoot) || is_link($runtimePag
|
||||
|
||||
// ── 3. Routes ───────────────────────────────────────────────────────
|
||||
|
||||
require 'config/router.php';
|
||||
$routeCatalog = RouteCatalog::fromConfigFile(__DIR__ . '/../config/routes.php');
|
||||
(new RouteRegistrar($moduleRegistry))->register($routeCatalog);
|
||||
$corePublicPaths = $routeCatalog->corePublicPaths();
|
||||
|
||||
// ── 4. Request context ──────────────────────────────────────────────
|
||||
|
||||
@@ -246,7 +250,7 @@ if (!$isApiRequest) {
|
||||
// ── 8. Access control guard ─────────────────────────────────────────
|
||||
|
||||
$allPublicPaths = array_values(array_unique(array_merge(
|
||||
defined('APP_PUBLIC_PATHS') ? APP_PUBLIC_PATHS : [],
|
||||
$corePublicPaths,
|
||||
$moduleRegistry->getPublicPaths()
|
||||
)));
|
||||
$accessControl = new AccessControl($allPublicPaths, app(IntendedUrlService::class));
|
||||
|
||||
Reference in New Issue
Block a user