Skip to content

CachingConfigHandler

CachingConfigHandler compiles the per-action configuration files placed in the “cache” subfolder of a module directory.

Canonical schema: request method (or ’*’) => [‘lifetime’ => …, ‘groups’ => […], ‘views’ => …, ‘action_attributes’ => […], ‘output_types’ => […]].

class CachingConfigHandler extends XmlConfigHandler implements IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler

ExtendsXmlConfigHandler
ImplementsIArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler
Since1.0.0
SourceConfig/CachingConfigHandler.php
ConstantValueDescription
XML_NAMESPACE'http://quiote.dev/quiote/config/parts/caching/1.1'
MethodDescription
execute(XmlConfigDomDocument $document): mixedExecute this configuration handler.
executeArray(array<string, mixed> $config, ?string $sourceRef = null): mixedThe declaration is the canonical map itself: the caching entries keyed by request method (or ’*’), for a caller to pick the matching one from.
schema(): Rule“layers” is a polymorphic per-layer-name map (true, or a list of slot names) not modeled key-by-key here — structural parity stops at the known, fixed keys of a caching entry and an output-type entry; the dynamic method/output-type/layer-name keys themselves are, correctly, unconstrained (Dict), same as SettingConfigHandler’s open shape.
toCanonicalArray(XmlConfigDomDocument $document): array<string, array<string, mixed>>
toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array<string, array<string, mixed>>, positions: array<string, array{file: string, line: int}>}Positions are only tracked for each caching entry’s own “lifetime” key, at the element’s line — a reasonable top-level anchor without mirroring the full recursive output_types/layers/slots walk above, which polymorphic “layers” values (true|list) don’t cleanly reduce to a single leaf position anyway.

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 $sourceRef = null): mixed

The declaration is the canonical map itself: the caching entries keyed by request method (or ’*’), for a caller to pick the matching one from.

ParameterTypeDescription
$configarray``<``string``, ``mixed``>
$sourceRef?``string

Returns mixed

public function schema(): Rule

“layers” is a polymorphic per-layer-name map (true, or a list of slot names) not modeled key-by-key here — structural parity stops at the known, fixed keys of a caching entry and an output-type entry; the dynamic method/output-type/layer-name keys themselves are, correctly, unconstrained (Dict), same as SettingConfigHandler’s open shape.

Returns Rule

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

ParameterTypeDescription
$documentXmlConfigDomDocument

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

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

Positions are only tracked for each caching entry’s own “lifetime” key, at the element’s line — a reasonable top-level anchor without mirroring the full recursive output_types/layers/slots walk above, which polymorphic “layers” values (true|list) don’t cleanly reduce to a single leaf position anyway.

ParameterTypeDescription
$documentXmlConfigDomDocument
$positionsElementPositionIndex

Returns array{data: array<string, 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.