Class Factory

Summary

Fully Qualified Name: Laminas\Config\Factory

Description

Methods

Name Description Defined By
fromFile() Read a config from a file. Factory
fromFiles() Read configuration from multiple files and merge them. Factory
getReaderPluginManager() Get the reader plugin manager. Factory
getWriterPluginManager() Get the writer plugin manager. Factory
registerReader() Set config reader for file extension Factory
registerWriter() Set config writer for file extension Factory
setReaderPluginManager() Set reader plugin manager Factory
setWriterPluginManager() Set writer plugin manager Factory
toFile() Writes a config to a file Factory

Method Details

fromFile()

Read a config from a file.

Parameter Name Type Description
$filename string
$returnConfigObject bool
$useIncludePath bool

Returns: array|\Config

fromFiles()

Read configuration from multiple files and merge them.

Parameter Name Type Description
$files array
$returnConfigObject bool
$useIncludePath bool

Returns: array|\Config

getReaderPluginManager()

Get the reader plugin manager.

If none is available, registers and returns a StandaloneReaderPluginManager instance by default.

Returns: \ContainerInterface

getWriterPluginManager()

Get the writer plugin manager.

If none is available, registers and returns a StandaloneWriterPluginManager instance by default.

Returns: \ContainerInterface

registerReader()

Set config reader for file extension

Parameter Name Type Description
$extension string
$reader string|\Reader\ReaderInterface

Returns: void

registerWriter()

Set config writer for file extension

Parameter Name Type Description
$extension string
$writer string|\Writer\AbstractWriter

Returns: void

setReaderPluginManager()

Set reader plugin manager

Parameter Name Type Description
$readers \ContainerInterface

Returns: void

setWriterPluginManager()

Set writer plugin manager

Parameter Name Type Description
$writers \ContainerInterface

Returns: void

toFile()

Writes a config to a file

Parameter Name Type Description
$filename string
$config array|\Config

Returns: bool TRUE on success | FALSE on failure

Top