Days_Config - work with the configuration of the site.
How to use
Example of use in php code:
// load default configutation (default.yaml) and return all sections
$config = Days_Config::load()->get();
// return database configuration
$config = Days_Config::load()->get('db/default');
// load specified configutation file and return specified option
$config = Days_Config::load('myconfig')->get('engine/brand');
// return specified value if option not exists
$config = Days_Config::load()->get('engine/brand', 'app');Parameters
Available configuration parameters:
- db - database configuration
- default - name of section (for use many databases in one project)
- adapter - database engine (available: mysql, mssql, pgsql, sqlite)
- host - database host (typically this "localhost")
- username - user for work with database (typycally "root")
- password - sasswork for user
- dbname - databse name in this engine (for example "phpdays")
- engine - engine settings
- debug - collect debug info (1 - enabled, 0 - disabled)
- brand - name of you application name (prefix for model classes)
- log - logging settings
- type - show debug info to: firephp, file, sqlite
- level - show errors only with specified levels (levels joided by "bytes or"). Value 31 - show all errors, and 0 - no show errors
- url - settings for url adress
- lang - default page language (en, ru, fr, ...)
- ext - default page type (html, wml, xml)
- base - delete this part of path from start of string
- virtual - call index action if specified action not exists (1 - enabled, 0 - disabled)
- view - settings for view
- engine - use template engine (available: smarty, dwoo, templum, php - for native php templates)
- cache - settings for cache support
- lifetime - cache data on this time (in seconds)
Configuration file writen on YAML syntax (see example).