Methods

Constant Processor walks through a Config structure and replaces all PHP constants with their respective values

__construct(bool $userOnly, string $prefix, string $suffix) : \Zend\Config\Processor\Constant

Parameters

$userOnly

bool

True to process only user-defined constants, false to process all PHP constants

$prefix

string

Optional prefix

$suffix

string

Optional suffix

Returns

Add new token.

addToken(string $token, mixed $value) : \Zend\Config\Processor\Token
Inherited

inherited_from \Zend\Config\Processor\Token::addToken()

Parameters

$token

string

$value

mixed

Exceptions

\Zend\Config\Exception\InvalidArgumentException

Returns

getPrefix()

getPrefix() : string
Inherited

inherited_from \Zend\Config\Processor\Token::getPrefix()

Returns

string

getSuffix()

getSuffix() : string
Inherited

inherited_from \Zend\Config\Processor\Token::getSuffix()

Returns

string

Get current token registry.

getTokens() : array

Returns

array

getUserOnly()

getUserOnly() : bool

Returns

bool

Load all currently defined constants into parser.

loadConstants() : void

Process the whole Config structure and recursively parse all its values.

process(\Zend\Config\Config $value) : \Zend\Config\Config
Inherited

inherited_from \Zend\Config\Processor\ProcessorInterface::process()

Parameters

Exceptions

\Zend\Config\Exception\InvalidArgumentException

Returns

Process a single value

processValue(mixed $value) : mixed
Inherited

inherited_from \Zend\Config\Processor\ProcessorInterface::processValue()

Parameters

$value

mixed

Returns

mixed

setPrefix()

setPrefix(string $prefix) : \Zend\Config\Processor\Token
Inherited

inherited_from \Zend\Config\Processor\Token::setPrefix()

Parameters

$prefix

string

Returns

setSuffix()

setSuffix(string $suffix) : \Zend\Config\Processor\Token
Inherited

inherited_from \Zend\Config\Processor\Token::setSuffix()

Parameters

$suffix

string

Returns

Add new token.

setToken(string $token, mixed $value) : \Zend\Config\Processor\Token
Inherited

inherited_from \Zend\Config\Processor\Token::setToken()

Parameters

$token

string

$value

mixed

Returns

Set token registry.

setTokens(array | \Zend\Config\Config | \Traversable $tokens) : \Zend\Config\Processor\Token
Inherited

inherited_from \Zend\Config\Processor\Token::setTokens()

Parameters

$tokens

array\Zend\Config\Config\Traversable

Associative array of TOKEN => value to replace it with

Exceptions

\Zend\Config\Exception\InvalidArgumentException

Returns

Should we use only user-defined constants?

setUserOnly(bool $userOnly) : \Zend\Config\Processor\Constant

Parameters

$userOnly

bool

Returns

Build replacement map

buildMap() : array
Inherited

inherited_from \Zend\Config\Processor\Token::buildMap()

Returns

array

Applies replacement map to the given value by modifying the value itself

doProcess(mixed $value, array $replacements) : mixed
Inherited

inherited_from \Zend\Config\Processor\Token::doProcess()

Parameters

$value

mixed

$replacements

array

Exceptions

\Zend\Config\Exception\InvalidArgumentException if the provided value is a read-only {@see Config}

Returns

mixed

 Properties

 

Replacement map

$map : array
Inherited

inherited_from \Zend\Config\Processor\Token::$$map
 

Token prefix.

$prefix : string
Inherited

inherited_from \Zend\Config\Processor\Token::$$prefix
 

Token suffix.

$suffix : string
Inherited

inherited_from \Zend\Config\Processor\Token::$$suffix
 

The registry of tokens

$tokens : array
Inherited

inherited_from \Zend\Config\Processor\Token::$$tokens
 

Replace only user-defined tokens

$userOnly : bool