Configuring your application

Introduction

The Fuel framework is built with configuration over convention in mind. This results in a highly customizable base on which you can start building your application.

Configuration files are stored inside the app/config folder. The application's basic configuration is done in app/config/config.php. The loaded configuration can be made environment specific, more on this under Environments.

Configuration options

Key Type Default Description
base_url string
null
The base URL of the application. Can be relative. MUST contain a trailing slash. ('/foo/', 'http://example.com/')
url_suffix string
''
Any suffix that needs to be added to URL's generated by Fuel. If the suffix is an extension, make sure to include the dot. ('.html')
index_file string
'index.php'
The name of the main bootstrap file. Set this to false or remove if you using mod_rewrite.
controller_prefix string
'Controller_'
The class prefix used to find controllers when mapping the URI to the controller class name. You have to change this if you want your controllers namespaced or in a different folder then app/classes/controller.
profiling bool
false
Whether to enable the profiler.
caching bool
false
Whether to enable caching.
cache_dir string
APPPATH.'cache/'
The directory to store cache files in. This directory must be writable.
cache_lifetime int
3600
The cache lifetime in seconds.
ob_callback callback
null
Callback given to ob_start(), set to ob_gzhandler to enable gzip encoding of output.
errors.continue_on array
array(
)
On which php errors to proceed execution. See Error handling.
errors.throttle int
10
How many errors to show before we stop showing them. (prevents out-of-memory errors)
errors.notices bool
true
Whether to show notices.
language string
'en'
The default application language, used by the Lang class.
locale string
'en_US'
Used for setlocale() required on some php installations, set to false to prevent it from being set.
The syntax setting for this can differ per OS, Ubuntu for example requires a .utf8 (the encoding) suffix.
encoding string
'UTF-8'
The application's default character encoding.
server_gmt_offset int
0
The offset in seconds the server offset from gmt timestamp when time() is used.
This is only to correct bad server configuration: time() should always return the number of seconds since January 1 1970 00:00:00 GMT.
default_timezone string
'UTC'
The server timezone.
log_threshold int
Fuel::L_WARNING
The logging threshold. From what level of message to log, or an array of specific message levels that should be logged. Read about the possible values
log_path string
APPPATH.'logs/'
The directory to store the logs in. This directory MUST be writable.
log_date_format string
'Y-m-d H:i:s'
The date/time format used in the logs.
security.csrf_autoload bool
false
Whether to auto-check the csrf token. Read more about csrf.
security.csrf_token_key string
'fuel_csrf_token'
Which $_POST key to fetch when checking the csrf token.
security.csrf_expiration int
0
Set the expiration time for the csrf cookie. Anything higher than 0 is the number of seconds in which the cookie will expire.
security.uri_filter array
array('htmlentities')
What php functions to use to filter the URI.
security.input_filter array
array()
What php functions filter the input arrays ($_GET, $_POST and $_COOKIE). Can be set to xxs_clean, this may cause a performance hit based on the size of the input.
security.output_filter array
array()
What php functions filter the variables set to a view. Can be set to xxs_clean, this may cause a performance hit based on the size of the variables.
security.auto_filter_output bool
true
Whether to automatically encode (htmlentities) view data.
security.whitelisted_classes array()
array(
'stdClass',
'Fuel\\Core\\View',
'Fuel\\Core\\ViewModel',
'Closure'
)
With output encoding switched on all objects passed will be converted to strings or throw exceptions unless they are instances of the classes in this array.
cookie.expiration int
0
Number of seconds before the cookie expires.
cookie.path string
'/'
Restrict the path that the cookie is available to.
cookie.domain string
null
Restrict the domain that the cookie is available to.
cookie.secure bool
false
Only transmit cookies over secure connections.
cookie.http_only bool
false
Only transmit cookies over HTTP, disabling Javascript access.
module_paths array
array()
Paths to module directories. Used when adding a module without specifying the location.
always_load.packages array
array()
Which packages to autoload. Specify like so: array('package') or array('package' => PKGPATH.'path/to/package')
always_load.modules array
array()
Which modules to autoload. Specify like so: array('package'). Autoloaded modules are accessible via the URL. In order for this to work a module path must be set in module_paths
always_load.classes array
array()
Which classes to autoload and initiate.
always_load.config array
array()
Which config files to autoload. Load a config file into a group like so: array('config') or array('filename' => 'group'). If you do not want to load the file into a set the group name to null: array('filename' => null).
always_load.language array
array()
Which language files to autoload. Load a config file into a group like so: array('lang') or array('filename' => 'group'). If you do not want to load the file into a set the group name to null: array('filename' => null).