SettingConfigHandler
SettingConfigHandler handles the settings.xml file.
The compilation logic (executeArray()) consumes a plain array rather than walking the DOM, so the same logic compiles a settings.php or settings.yaml file (via Quiote\Config\Format\FormatDriverRegistry::forHandler()), not just XML.
The canonical array shape is a flat, dot-keyed map: ‘actions.{name}_module’ => string (from <system_action name=”…”>
A PHP-array or YAML settings file is simply this map written directly, e.g. return ['core.app_name' => 'Demo', 'core.debug' => true]; — there is no XML-specific concept (system_actions/settings/prefix wrappers) left to represent once you’re at this shape.
The compiled artifact returns that map; SettingConfigHandler::apply() is what feeds it to Config.
Synopsis
Section titled “Synopsis”class SettingConfigHandler extends XmlConfigHandler implements IArrayConfigHandler, IDeclarationConfigHandler
| Extends | XmlConfigHandler |
| Implements | IArrayConfigHandler, IDeclarationConfigHandler |
| Since | 1.0.0 |
| Source | Config/SettingConfigHandler.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
XML_NAMESPACE | 'http://quiote.dev/quiote/config/parts/settings/1.1' |
Methods
Section titled “Methods”| Method | Description |
|---|---|
apply(mixed $declaration, string $sourceRef): void | Feed the declared settings into the configuration repository. |
execute(XmlConfigDomDocument $document): mixed | Execute this configuration handler. |
executeArray(array $config, ?string $sourceRef = null): mixed | Returns the flat setting map unchanged as the declaration to cache. |
toCanonicalArray(XmlConfigDomDocument $document): array | Flattens the document’s system actions and settings into the dot-keyed map described in this class’s summary. |
apply()
Section titled “apply()”public function apply(mixed $declaration, string $sourceRef): void
Feed the declared settings into the configuration repository.
The flat, dot-keyed map described in this class’s summary.
| Parameter | Type | Description |
|---|---|---|
$declaration | mixed | The flat, dot-keyed map described in this class’s summary. |
$sourceRef | string |
execute()
Section titled “execute()”public function execute(XmlConfigDomDocument $document): mixed
Execute this configuration handler.
The document to parse.
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument | The document to parse. |
Returns mixed — The declaration to be cached.
| Throws | When |
|---|---|
UnreadableException | If a requested configuration file does not exist or is not readable. |
ParseException | If a requested configuration file is improperly formatted. |
executeArray()
Section titled “executeArray()”public function executeArray(array $config, ?string $sourceRef = null): mixed
Returns the flat setting map unchanged as the declaration to cache.
The map is already the compiled artifact; SettingConfigHandler::apply() is what later feeds it into Config.
| Parameter | Type | Description |
|---|---|---|
$config | array | |
$sourceRef | ?``string |
Returns mixed
toCanonicalArray()
Section titled “toCanonicalArray()”public function toCanonicalArray(XmlConfigDomDocument $document): array
Flattens the document’s system actions and settings into the dot-keyed map described in this class’s summary.
Each system action contributes an actions.{name}_module and an actions.{name}_action entry. Each setting is keyed by its name behind a prefix — core. unless an enclosing <settings prefix="..."> overrides it for its children — and takes either its nested parameters or its literalized text value.
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument |
Returns array
| Throws | When |
|---|---|
ParseException | if a system action is missing its <module> or <action> child. |
Inherited methods
Section titled “Inherited methods”These come from an ancestor and are documented where they are declared.
| Method | Declared in | Description |
|---|---|---|
appendParameter() | ParameterHolder | Append a parameter. |
appendParameterByRef() | ParameterHolder | Append a parameter by reference. |
clearParameters() | ParameterHolder | Clear all parameters associated with this request. |
getFlatParameterNames() | ParameterHolder | Retrieve an array of flattened parameter names. |
getParameter() | ParameterHolder | Retrieve a parameter. |
getParameterNames() | ParameterHolder | Retrieve an array of parameter names. |
getParameters() | ParameterHolder | Retrieve an array of parameters. |
hasParameter() | ParameterHolder | Indicates whether or not a parameter exists. |
initialize() | XmlConfigHandler | Initialize this ConfigHandler. |
literalize() | BaseConfigHandler | Literalize a string value. |
removeParameter() | ParameterHolder | Remove a parameter. |
replaceConstants() | BaseConfigHandler | Replace configuration directive identifiers in a string. |
replacePath() | BaseConfigHandler | Replace a relative filesystem path with an absolute one. |
reset() | ParameterHolder | Removes every parameter held, leaving the holder empty for reuse. |
setParameter() | ParameterHolder | Set a parameter. |
setParameterByRef() | ParameterHolder | Set a parameter by reference. |
setParameters() | ParameterHolder | Set an array of parameters. |
setParametersByRef() | ParameterHolder | Set an array of parameters by reference. |