Skip to content

BaseConfigHandler

BaseConfigHandler allows a developer to create a custom formatted configuration file pertaining to any information they like.

A handler returns a declaration — data — from execute(); turning that into the compiled cache file is the cache’s job (see CompiledArtifact), not the handler’s.

abstract class BaseConfigHandler extends ParameterHolder

ExtendsParameterHolder
Since1.0.0
SourceConfig/BaseConfigHandler.php
MethodDescription
literalize(mixed $value): mixedLiteralize a string value.
replaceConstants(string $value): stringReplace configuration directive identifiers in a string.
replacePath(string $path): stringReplace a relative filesystem path with an absolute one.

public static function literalize(mixed $value): mixed

Literalize a string value.

The value to literalize.

ParameterTypeDescription
$valuemixedThe value to literalize.

Returns mixed — A literalized value.

public static function replaceConstants(string $value): string

Replace configuration directive identifiers in a string.

The value on which to run the replacement procedure.

ParameterTypeDescription
$valuestringThe value on which to run the replacement procedure.

Returns string — The new value.

public static function replacePath(string $path): string

Replace a relative filesystem path with an absolute one.

A relative filesystem path.

ParameterTypeDescription
$pathstringA relative filesystem path.

Returns string — The new path.

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.
removeParameter()ParameterHolderRemove a parameter.
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.