Config listener

 Methods

__construct

__construct(\Zend\ModuleManager\Listener\ListenerOptions $options) 

Add a glob path of config files to merge after loading modules

addConfigGlobPath(string $globPath) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$globPath

string

Returns

Add an array of glob paths of config files to merge after loading modules

addConfigGlobPaths(array | \Traversable $globPaths) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$globPaths

array\Traversable

Returns

Add a static path of config files to merge after loading modules

addConfigStaticPath(string $staticPath) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$staticPath

string

Returns

Add an array of static paths of config files to merge after loading modules

addConfigStaticPaths(array | \Traversable $staticPaths) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$staticPaths

array\Traversable

Returns

Attach one or more listeners

attach(\Zend\EventManager\EventManagerInterface $events) : void

Implementors may add an optional $priority argument; the EventManager implementation will pass this to the aggregate.

Parameters

Detach all previously attached listeners

detach(\Zend\EventManager\EventManagerInterface $events) : void

getMergedConfig

getMergedConfig(bool $returnConfigAsObject) : mixed

Parameters

$returnConfigAsObject

bool

Returns

mixed

Get options.

getOptions() : \Zend\ModuleManager\Listener\ListenerOptions
Inherited

inherited_from \Zend\ModuleManager\Listener\AbstractListener::getOptions()

Returns

Merge the config for each module

onLoadModule(\Zend\ModuleManager\ModuleEvent $e) : \Zend\ModuleManager\Listener\ConfigListener

Merge all config files matched by the given glob()s

onLoadModulesPost(\Zend\ModuleManager\ModuleEvent $e) : \Zend\ModuleManager\Listener\ConfigListener

This is only attached if config is not cached.

Parameters

Returns

Pass self to the ModuleEvent object early so everyone has access.

onloadModulesPre(\Zend\ModuleManager\ModuleEvent $e) : \Zend\ModuleManager\Listener\ConfigListener

setMergedConfig

setMergedConfig(array $config) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$config

array

Returns

Set options.

setOptions(\Zend\ModuleManager\Listener\ListenerOptions $options) : \Zend\ModuleManager\Listener\AbstractListener
Inherited

inherited_from \Zend\ModuleManager\Listener\AbstractListener::setOptions()

Parameters

Returns

addConfig()

addConfig(string $key, array | \Traversable $config) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$key

string

$config

array\Traversable

Exceptions

\Zend\ModuleManager\Listener\Exception\InvalidArgumentException

Returns

Given a path (glob or static), fetch the config and add it to the array of configs to merge.

addConfigByPath(string $path, string $type) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$path

string

$type

string

Returns

Add a path of config files to load and merge after loading modules

addConfigPath(string $path, string $type) : \Zend\ModuleManager\Listener\ConfigListener

Add an array of paths of config files to merge after loading modules

addConfigPaths(\Traversable | array $paths, string $type) : \Zend\ModuleManager\Listener\ConfigListener

Parameters

$paths

\Traversablearray

$type

string

Exceptions

\Zend\ModuleManager\Listener\Exception\InvalidArgumentException

Returns

getCachedConfig()

getCachedConfig() : mixed

Returns

mixed

hasCachedConfig()

hasCachedConfig() : bool

Returns

bool

Write a simple array of scalars to a file

writeArrayToFile(string $filePath, array $array) : \Zend\ModuleManager\Listener\AbstractListener
Inherited

inherited_from \Zend\ModuleManager\Listener\AbstractListener::writeArrayToFile()

Parameters

$filePath

string

$array

array

Returns

 Properties

 

$callbacks

$callbacks : array

 

$configs

$configs : array

 

$mergedConfig

$mergedConfig : array

 

$mergedConfigObject

$mergedConfigObject : \Zend\Config\Config

 

$options

$options : \Zend\ModuleManager\Listener\ListenerOptions
Inherited

inherited_from \Zend\ModuleManager\Listener\AbstractListener::$$options
 

$paths

$paths : array

 

$skipConfig

$skipConfig : bool

 Constants

 

GLOB_PATH

GLOB_PATH 

 

STATIC_PATH

STATIC_PATH