The Config class.
Contains all configuration options and a set of config helper methods.
◆ __construct()
Constructor.
Depending on the type of the parameter passed to this function, config array is used directly or it is loaded from a file.
Important: If you use a PHP file to store your config, remember to use the return
statement inside the file scope to return the array.
- Parameters
-
- Exceptions
-
InvalidConfigException | if config was not loaded properly |
◆ extend()
extend |
( |
|
$nodeName, |
|
|
array |
$values |
|
) |
| |
If the config node does not exist, creates the node with a given name and values. Otherwise extends the config node with additional (default) values.
- Parameters
-
◆ get()
Returns the configuration node under the path defined in the parameter.
For easier access to nested configuration options the config $name
parameter can be passed also as a dot-separated path. For example, to check if thumbnails are enabled you can use:
$config->get('thumbnails.enabled')
- Parameters
-
string | $name | config node name |
- Returns
- mixed config node value
◆ getBackendNode()
getBackendNode |
( |
|
$backendName | ) |
|
Returns backend configuration by name.
- Parameters
-
- Returns
- array backend configuration node
- Exceptions
-
InvalidArgumentException
◆ getDefaultResourceTypes()
getDefaultResourceTypes |
( |
| ) |
|
Returns the default resource types names.
- Returns
- array
◆ getHideFilesRegex()
Returns the regex used for hidden files check.
- Returns
- string
◆ getHideFoldersRegex()
Returns the regex used for hidden folders check.
- Returns
- string
◆ getPrivateDirPath()
getPrivateDirPath |
( |
|
$privateDirIdentifier | ) |
|
Returns the backend-relative private directory path.
- Parameters
-
string | $privateDirIdentifier | |
- Returns
- mixed
◆ getResourceTypeNode()
getResourceTypeNode |
( |
|
$resourceType | ) |
|
Returns the configuration node for a given resource type.
- Parameters
-
string | $resourceType | resource type name |
- Returns
- array configuration node for the resource type
- Exceptions
-
InvalidResourceTypeException | if the resource type does not exist |
◆ getResourceTypes()
Returns all defined resource types names.
- Returns
- array
◆ isDebugLoggerEnabled()
isDebugLoggerEnabled |
( |
|
$loggerName | ) |
|
Checks if the debug logger with a given name is enabled.
- Parameters
-
string | $loggerName | debug logger name |
- Returns
- bool
true
if enabled
◆ mergeDefaultOptions()
mergeDefaultOptions |
( |
|
$options | ) |
|
|
protected |
Merges default or missing configuration options.
- Parameters
-
- Returns
- array
◆ process()
Processes the configuration array.
◆ validate()
Validates the config array structure.
- Exceptions
-
InvalidConfigException | if config structure is invalid |
The documentation for this class was generated from the following file: