\Hazaar\Application
Config
Application Configuration Class

The config class loads settings from a configuration file and configures the system ready for the application to run. By default the config file used is application.ini and is stored in the config folder of the application path.

Tags

Since

1.0.0

Summary
Methods Properties Constants
No constants
Properties
$env
$env
$loaded
$loaded
Static
$override_paths
$override_paths
$source
$source
Methods
__construct()
__construct($source_file = null, $env = null, $defaults = Array ( ) , $path_type = 'file_path_config', $override_namespaces = false)

The application configuration constructor loads the settings from the configuration file specified in the first parameter. It will use the second parameter as the starting point and is intended to allow different operating environments to be configured from a single configuration file.

Tags

Since

1.0.0

Parameters

$source_filestring

The absolute path to the config file

$envstring

The application environment to read settings for. Usually development

                                 or `production`.
$defaultsmixed

Initial defaut values.

$path_typemixed

The search path type to look for configuration files.

$override_namespaces

No description

__tostring()
__tostring() : string
Output the configuration in a human readable format.

This method is useful for logging, debugging or for using in application administration interfaces to check the current running configuration.

Example Output

app.name = Example Application
app.version = 0.0.1
app.layout = application
app.theme.name = test
app.defaultController = Index
app.compress = false
app.debug = 1
paths.model = models
paths.view = views
paths.controller = controllers
php.date.timezone = Australia/ACT
php.display_startup_errors = 1
php.display_errors = 1
module.require[] = pgsql

Tags

Since

1.0.0

Returns

string

Config as a multi-line string

getEnv()
getEnv()
Get the config environment that was loaded

Tags

Since

2.0.0

getSource()
getSource()
Get the source file content from which the settings originated

Tags

Since

1.0.0

getSourceFilename()
getSourceFilename()
load()
load($source, $defaults = Array ( ) , $path_type = 'file_path_config', $override_paths = null, $override_namespaces = false)

Parameters

$source

No description

$defaults

No description

$path_type

No description

$override_paths

No description

$override_namespaces

No description

loadConfigOptions()
loadConfigOptions($options, $config, $env = null)

Parameters

$options

No description

$config\Hazaar\Map

No description

$env

No description

loadSourceFile()
loadSourceFile($source)

Parameters

$source

No description

loaded()
loaded()
Check whether the config was loaded from the source file.
parseString()
parseString($elem, $key)

Parameters

$elem

No description

$key

No description

tostring()
tostring()
write()
write($target = null)

Parameters

$target

No description