The following is a YAML version of a standard application configuration.
production: phpSettings: display_startup_errors: false display_errors: false includePaths: library: APPLICATION_PATH/../library bootstrap: path: APPLICATION_PATH/Bootstrap.php class: "Bootstrap" appnamespace: "Application" resources: frontController: controllerDirectory: APPLICATION_PATH/controllers moduleDirectory: APPLICATION_PATH/modules params: displayExceptions: false modules: db: adapter: "pdo_sqlite" params: dbname: APPLICATION_PATH/../data/db/application.db layout: layoutPath: APPLICATION_PATH/layouts/scripts/ staging: _extends: production testing: _extends: production phpSettings: display_startup_errors: true display_errors: true development: _extends: production phpSettings: display_startup_errors: true display_errors: true resources: frontController: params: displayExceptions: true
To utilize it, you simply instantiate
it to the location of this file and indicating the section of the file to load. By
default, constant names found in values will be substituted with their appropriate
$config = new Zend_Config_Yaml(
APPLICATION_PATH . '/configs/application.yaml',
Once instantiated, you use it as you would any other configuration object.
$db = Zend_Db::factory($config->resources->db);