^Status|Draft|
^Todo|How config entries merge, Proof read|
====== Configuration ======
Information on retrieving and setting configuration items can be found on the [[core:kohana#methods_config|kohana]] page.
===== Structure of config files =====
Configuration files contain an array named ''$config''. Keys of this array are the actual configuration items e.g.
**Example**
$config['site_domain'] = 'localhost/';
===== File structure of config files =====
The file structure of config files follows Kohana's file structure.
application > modules > system
Meaning that configuration files in the application directory take precedence over those in modules which take precedence over those in the system directory. The one exception is ''config.php'' which is hardcoded into the ''application/config'' directory and cannot be moved elsewhere.
===== config.php =====
The file [[general:configuration:config|config.php]] is hardcoded into Kohana, meaning it **has to be** in the ''application/config'' directory.
/*
* Options:
* site_domain - domain and installation directory
* site_protocol - protocol used to access the site, usually HTTP
* index_page - name of the front controller, can be removed with URL rewriting
* url_suffix - an extension that will be added to all generated URLs
* internal_cache - whether to store file paths and config entries across requests
* output_compression - enable or disable GZIP output compression
* global_xss_filtering - enable or disable XSS attack filtering on all user input
* enable_hooks - enable or disable hooks.
* log_threshold - sets the logging threshold
* log_directory - directory to save logs to
* display_errors - whether to show Kohana error pages or not
* render_stats - render the statistics information in the final page output
* extension_prefix - filename prefix for library extensions
* modules - extra Kohana resource paths,
*/
===== Configuration files =====
=== cache.php ===
Sets the cache driver, cache lifetime and garbage collection. For more information see the [[libraries:cache|Cache]] library.
=== captcha.php ===
Sets defaults for captcha images. For more information see the [[libraries:captcha|Captcha]] library.
=== cookie.php ===
Sets defaults for cookies. For more information see the [[helpers:cookie|Cookie]] helper.
=== credit_cards.php ===
Validation options for various credit cards.
=== database.php ===
Sets database connection settings. Multiple configurations are possbile. For more information see the database [[libraries:database:configuration|configuration]] library.
=== email.php ===
Sets email sending options. For more information see the [[helpers:email|Email]] helper.
=== encryption.php ===
Sets encryption options such as key, mode and cipher. For more information see the [[libraries:encrypt|Encrypt]] library.
=== http.php ===
Sets HTTP-EQUIV type meta tags.
=== image.php ===
Sets the image driver - GD or ImageMagick directory
=== inflector.php ===
For more information see the [[helpers:inflector|Inflector]] helper.
=== locale.php ===
Sets the locale and timezone of an application. For more information see the [[general:i18n|Internationalization]] page.
=== mimes.php ===
Sets the available mime-types. (See the validation/upload page?)
=== pagination.php ===
Sets pagination settings. For more information see the [[libraries:pagination|Pagination]] page.
=== payment.php ===
Sets payment settings.
=== profiler.php ===
Sets the information the profiler should show. For more information see the [[libraries:profiler|Profiler]] library.
=== routes.php ===
Sets the routes Kohana should use. Includes ''_default'' and ''_allowed''. For more infromation see the [[general:routing|Routing]] page.
=== session.php ===
Sets session settings including the session driver. For more information see the [[libraries:session|Session]] library.
=== sql_types.php ===
Sets SQL data types.
=== upload.php ===
Sets upload directory.
=== user_agents.php ===
Sets available user agents including robots and mobile browsers. For more information see the [[libraries:user_agent|User Agent]] library.
=== view.php ===
Allowed file types (deprecated?)
===== How to dynamically set and retrieve config items =====
Information for this topic is located at [[core::kohana]].