Skip to content

MiddlewareConfigRegistry

Process-global accumulator for <use> entries contributed by compiled middleware.{xml,php,yaml,yml} files (the app’s own plus any module’s Config/middleware.*), mirroring PluginManager’s role for plugins.*.

Contributions are validated here, at compile/bootstrap time, rather than deferred to MiddlewarePipeline’s first build: a config file that tries to touch one of the framework’s own shipped middleware classes (see CoreMiddlewareRegistry::guardedClasses(), which covers both the pipeline’s own map and first-party security middleware shipped in its own package, such as CSRF) without both the per-entry override-framework="true" attribute AND the global core.middleware.allow_framework_overrides setting fails loudly the moment that file is loaded, not on the first HTTP request.

final class MiddlewareConfigRegistry

Since1.0.0
SourceMiddleware/Config/MiddlewareConfigRegistry.php
ConstantValueDescription
OVERRIDE_SETTING'core.middleware.allow_framework_overrides'
MethodDescription
all(): list<array{class: string, phase: ?string, priority: ?int, before: ?string, after: ?string, enabled: ?bool, override_framework: bool, sourceRef: string}>
contribute(list<array{class: string, phase: ?string, priority: ?int, before: ?string, after: ?string, enabled: ?bool, override_framework: bool}> $entries, string $sourceRef): void
reset(): voidTest isolation.

public static function all(): list<array{class: string, phase: ?string, priority: ?int, before: ?string, after: ?string, enabled: ?bool, override_framework: bool, sourceRef: string}>

Returns list``<``array{class: string, phase: ?string, priority: ?int, before: ?string, after: ?string, enabled: ?bool, override_framework: bool, sourceRef: string}``>

public static function contribute(list<array{class: string, phase: ?string, priority: ?int, before: ?string, after: ?string, enabled: ?bool, override_framework: bool}> $entries, string $sourceRef): void

ParameterTypeDescription
$entrieslist``<``array{class: string, phase: ?string, priority: ?int, before: ?string, after: ?string, enabled: ?bool, override_framework: bool}``>
$sourceRefstring

public static function reset(): void

Test isolation.