Skip to content

ConfigHandlersConfigHandler

ConfigHandlersConfigHandler allows you to specify configuration handlers for the application or on a module level.

Migrated to IArrayConfigHandler. Canonical schema is exactly the $handlers map execute() used to build inline: [‘pattern’ => [‘class’ => …, ‘parameters’ => […], ‘transformations’ => […], ‘validations’ => […]]] Note this handler is what config_handlers.xml itself compiles through — it is NOT what the extension-agnostic handler discovery reads (that would be circular); it stays the framework’s own bootstrap-time handler registry regardless of what format future handler configs adopt.

Middleware enable/disable used to be configured inline here via a reserved <middleware_config> block (compiled to a __middleware_config array key); that’s superseded by middleware.xml’s <use enabled="..."> (see MiddlewareConfigHandler), which also covers registration and ordering in the same place.

class ConfigHandlersConfigHandler extends XmlConfigHandler implements IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler

ExtendsXmlConfigHandler
ImplementsIArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler
Since1.0.0
SourceConfig/ConfigHandlersConfigHandler.php
ConstantValueDescription
XML_NAMESPACE'http://quiote.dev/quiote/config/parts/config_handlers/1.1'
MethodDescription
execute(XmlConfigDomDocument $document): mixedExecute this configuration handler.
[`executeArray(array<string, mixed> $config, stringnull $sourceRef = null): mixed`](#executearray)
schema(): Rule“transformations”/“validations” are fixed-shape but deeply nested (stage -> step -> validation-type -> file list) internal bootstrap data, not something an app author hand-edits key-by-key — validated only as “present”, not modeled key-by-key here.
toCanonicalArray(XmlConfigDomDocument $document): array<string, mixed>
toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array<string, mixed>, positions: array<string, array{file: string, line: int}>}

public function execute(XmlConfigDomDocument $document): mixed

Execute this configuration handler.

The document to parse.

ParameterTypeDescription
$documentXmlConfigDomDocumentThe document to parse.

Returns mixed — The declaration to be cached.

ThrowsWhen
UnreadableExceptionIf a requested configuration file does not exist or is not readable.
ParseExceptionIf a requested configuration file is improperly formatted.

public function executeArray(array<string, mixed> $config, string|null $sourceRef = null): mixed

Origin reference for the compiled cache file’s header comment (a file path for any format; XML’s is $document->documentURI).

ParameterTypeDescription
$configarray``<``string``, ``mixed``>The canonical config array, matching the shape returned by toCanonicalArray().
$sourceRef`string““null`

Returns mixed — The declaration to be cached, exactly as IXmlConfigHandler::execute() returns.

public function schema(): Rule

“transformations”/“validations” are fixed-shape but deeply nested (stage -> step -> validation-type -> file list) internal bootstrap data, not something an app author hand-edits key-by-key — validated only as “present”, not modeled key-by-key here.

Returns Rule

public function toCanonicalArray(XmlConfigDomDocument $document): array<string, mixed>

ParameterTypeDescription
$documentXmlConfigDomDocument

Returns array``<``string``, ``mixed``>

public function toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array<string, mixed>, positions: array<string, array{file: string, line: int}>}

ParameterTypeDescription
$documentXmlConfigDomDocument
$positionsElementPositionIndex

Returns array{data: array<string, mixed>, positions: array<string, array{file: string, line: int}>}

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
appendParameter()ParameterHolderAppend a parameter.
appendParameterByRef()ParameterHolderAppend a parameter by reference.
clearParameters()ParameterHolderClear all parameters associated with this request.
getFlatParameterNames()ParameterHolderRetrieve an array of flattened parameter names.
getParameter()ParameterHolderRetrieve a parameter.
getParameterNames()ParameterHolderRetrieve an array of parameter names.
getParameters()ParameterHolderRetrieve an array of parameters.
hasParameter()ParameterHolderIndicates whether or not a parameter exists.
initialize()XmlConfigHandlerInitialize this ConfigHandler.
literalize()BaseConfigHandlerLiteralize a string value.
removeParameter()ParameterHolderRemove a parameter.
replaceConstants()BaseConfigHandlerReplace configuration directive identifiers in a string.
replacePath()BaseConfigHandlerReplace a relative filesystem path with an absolute one.
reset()ParameterHolderRemoves every parameter held, leaving the holder empty for reuse.
setParameter()ParameterHolderSet a parameter.
setParameterByRef()ParameterHolderSet a parameter by reference.
setParameters()ParameterHolderSet an array of parameters.
setParametersByRef()ParameterHolderSet an array of parameters by reference.