Config listener

package Default
inherited_from \Zend\ModuleManager\Listener\AbstractListener

 Methods

__construct

__construct(\Zend\ModuleManager\Listener\ListenerOptions $options = null
inherited_from \Zend\ModuleManager\Listener\AbstractListener::__construct()

Parameters

$options

\Zend\ModuleManager\Listener\ListenerOptions

__construct

__construct(\Zend\ModuleManager\Listener\ListenerOptions $options = null
Inherited

Parameters

$options

\Zend\ModuleManager\Listener\ListenerOptions

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

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

Parameters

$globPath

string

Returns

\Zend\ModuleManager\Listener\ConfigListener

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

\Zend\ModuleManager\Listener\ConfigListener

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

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

Parameters

$staticPath

string

Returns

\Zend\ModuleManager\Listener\ConfigListener

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

\Zend\ModuleManager\Listener\ConfigListener

Attach one or more listeners

attach(\Zend\EventManager\EventManagerInterface $events) 

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

inherited_from \Zend\EventManager\ListenerAggregateInterface::attach()

Parameters

$events

Detach all previously attached listeners

detach(\Zend\EventManager\EventManagerInterface $events) 
inherited_from \Zend\EventManager\ListenerAggregateInterface::detach()

Parameters

$events

getMergedConfig

getMergedConfig(boolean $returnConfigAsObject = true) : mixed
inherited_from \Zend\ModuleManager\Listener\ConfigMergerInterface::getMergedConfig()

Parameters

$returnConfigAsObject

boolean

Returns

mixed

Get options.

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

Returns

\Zend\ModuleManager\Listener\ListenerOptions

Merge the config for each module

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

Parameters

$e

\Zend\ModuleManager\ModuleEvent

Returns

\Zend\ModuleManager\Listener\ConfigListener

Optionally cache merged config

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

This is only attached if config is not cached.

Parameters

$e

\Zend\ModuleManager\ModuleEvent

Returns

\Zend\ModuleManager\Listener\ConfigListener

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

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

This is only attached if config is not cached.

Parameters

$e

\Zend\ModuleManager\ModuleEvent

Returns

\Zend\ModuleManager\Listener\ConfigListener

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

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

Parameters

$e

\Zend\ModuleManager\ModuleEvent

Returns

\Zend\ModuleManager\Listener\ConfigListener

setMergedConfig

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

Parameters

$config

array

Returns

\Zend\ModuleManager\Listener\ConfigListener

Set options.

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

Parameters

$options

\Zend\ModuleManager\Listener\ListenerOptions

the value to be set

Returns

\Zend\ModuleManager\Listener\AbstractListener

addConfig()

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

Parameters

$key

string

$config

array\Traversable

Exceptions

\Zend\ModuleManager\Listener\Exception\InvalidArgumentException

Returns

\Zend\ModuleManager\Listener\ConfigListener

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

\Zend\ModuleManager\Listener\ConfigListener

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

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

Parameters

$path

string

$type

string

Exceptions

\Zend\ModuleManager\Listener\Exception\InvalidArgumentException

Returns

\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

\Zend\ModuleManager\Listener\ConfigListener

getCachedConfig()

getCachedConfig() : mixed

Returns

mixed

hasCachedConfig()

hasCachedConfig() : boolean

Returns

boolean

Write a simple array of scalars to a file

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

Parameters

$filePath

string

$array

array

Returns

\Zend\ModuleManager\Listener\AbstractListener

 Properties

 

$callbacks

$callbacks : array

Default

array()
 

$configs

$configs : array

Default

array()
 

$mergedConfig

$mergedConfig : array

Default

array()
 

$mergedConfigObject

$mergedConfigObject : \Zend\Config\Config

Default

 

$options

$options : \Zend\ModuleManager\Listener\ListenerOptions

Default

 

$paths

$paths : array

Default

array()
 

$skipConfig

$skipConfig : boolean

Default

false

 Constants

 

GLOB_PATH

GLOB_PATH = 'glob_path' 
 

STATIC_PATH

STATIC_PATH = 'static_path'