(Yaf >=1.0.0)
Yaf_Config_Simple::__construct — Constructor of Yaf_Config_Simple
Creates a new Yaf_Config_Simple instance from an array of configuration values.
valuesAn array of configuration values.
readonlyWhether the configuration should be read-only. Defaults to false (writable).
No value is returned.
Example #1 Yaf_Config_Simple::__construct() example
<?php
$config = new Yaf_Config_Simple([
'application' => ['name' => 'MyApp', 'env' => 'production'],
'database' => ['host' => 'localhost', 'port' => 3306],
]);
echo $config->application->name, "\n";
echo $config->database->host, "\n";
// The optional second argument makes the configuration read-only
$frozen = new Yaf_Config_Simple(['env' => 'testing'], true);
var_dump($frozen->readonly());
?>The above example will output something similar to:
MyApp localhost bool(true)