This is documentation for Kohana v2.3.x.

Table of Contents
StatusDraft
TodoHow config entries merge, Proof read

Configuration

Information on retrieving and setting configuration items can be found on the 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 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 Cache library.

captcha.php

Sets defaults for captcha images. For more information see the Captcha library.

cookie.php

Sets defaults for cookies. For more information see the 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 configuration library.

email.php

Sets email sending options. For more information see the Email helper.

encryption.php

Sets encryption options such as key, mode and cipher. For more information see the 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 Inflector helper.

locale.php

Sets the locale and timezone of an application. For more information see the Internationalization page.

mimes.php

Sets the available mime-types. (See the validation/upload page?)

pagination.php

Sets pagination settings. For more information see the Pagination page.

payment.php

Sets payment settings.

profiler.php

Sets the information the profiler should show. For more information see the Profiler library.

routes.php

Sets the routes Kohana should use. Includes _default and _allowed. For more infromation see the Routing page.

session.php

Sets session settings including the session driver. For more information see the 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 User Agent library.

view.php

Allowed file types (deprecated?)

How to dynamically set and retrieve config items

Information for this topic is located at kohana.