Craft comes with a bunch of config settings that give you control over various a
spects of its behavior.
All config settings should be placed within the array() in your craft/config/gen
eral.php file.
For example, if you want to enable Dev Mode and set Craft to use uncompressed Ja
vascript files, your array would look like this:
return array(
'devMode' => true,
'useCompressedJs' => false,
);
Here is the definitive list of config settings you can add:
General #
appId #
Accepts A string
Default null
Since Craft 2.2
The application ID, which is used for things like storing data caches and user s
essions. If it s not set, Craft will automatically generate one based on the serve
r path. Setting it will help avoid the loss of data caches and user sessions whe
n Craft is deployed using a deployment script that will store Craft in an incons
istent location, such as Capistrano.
'appId' => 'lannister',
cacheDuration #
Accepts A string set to any valid PHP interval specification, or false if you wi
sh to cache data indefinitely.
Default 'P1D' (one day)
Since Craft 1.0
The length of time Craft will store data caches. Also used by the {% cache %} te
mplate tag if no expiration time is specified as a parameter.
'cacheDuration' => 'P1W',
cacheMethod #
Accepts 'apc', 'db', 'eaccelerator', 'file', 'memcache', 'redis', 'wincache', 'x
cache', or 'zenddata'
Default 'file'
Since Craft 2.0
The method Craft will use to store data caches.
'cacheMethod' => 'memcache',
Note that this config setting has no effect on the {% cache %} template tag, whi
ch always stores its data in the database.
The DB, file, Memcache(d), and Redis cache methods each have their own additiona
l config settings, which must be set in separate config files in the craft/confi
g/ folder (dbcache.php, filecache.php, memcache.php and rediscache.php, respecti
vely). You can find their default values in craft/app/etc/config/defaults/.
customAsciiCharMappings #
Accepts An array of key/value pairs mapping character codes to lower ASCII strin
gs
Default array() (an empty array)
more info.)
'devMode' => true,
Dev Mode should never be enabled in production environments.
defaultWeekStartDay #
Accepts A number from 0 to 6 (where 0 represents Sunday and 6 represents Saturda
y)
Default 0 (Sunday)
Since Craft 2.5
The number representing the default Week Start Day preference value for new user
s.
environmentVariables #
Accepts An array of key/value string pairs
Default array() (an empty array)
Since Craft 1.1
An array of environment-specific variables which can be accessed as tags within
URL and Path settings. (See Multi-Environment Configs for more info.)
'environmentVariables' => array(
'baseAssetUrl' => '//example.com/',
'baseAssetPath' => './',
),
isSystemOn #
Accepts true, false, or null
Default null
Since Craft 2.1
Overrides the System Status
true or false
true
Craft 2.4
the X-Powered-By: Craft CMS header should be sent along with each reques
Default null
Since Craft 2.3
Your site s name. If this is set, it will take precedence over the Site Name setti
ng in Settings ? General.
'siteName' => array(
'en' => 'On the Rocks',
'es' => 'Con Hielo'
),
siteUrl #
Accepts A string set to any valid URL, or an array that maps locale IDs to local
e-specific URLs
Default null
Since Craft 2.0
Your site s URL. If this is set, it will take precedence over the Site URL setting
in Settings ? General, as well as the CRAFT_SITE _URL constant, if set.
This is the recommended way to set the site URL on multi-lingual sites, as it gi
ves Craft a way of knowing the correct URLs it should point localized entries/ca
tegories to.
'siteUrl' => array(
'en' => 'http://example.com/',
'de' => 'http://example.de/'
),
timezone #
Accepts A string set to a valid PHP timezone.
Default null
Since Craft 2.3
The system timezone. If this is set, it will take precedence over the Timezone s
etting in Settings ? General.
'timezone' => 'America/Los_Angeles',
translationDebugOutput #
Accepts true or false
Default false
Since Craft 1.0
Tells Craft whether to surround all strings that are ran through Craft::t() or t
he |translate filter with @ symbols, to help find any strings that are not being t
ranslated.
'translationDebugOutput' => true,
useCompressedJs #
Accepts true or false
Default true
Since Craft 1.0
Tells Craft whether to use compressed Javascript files whenever possible, to cut
down on page load times.
'useCompressedJs' => false,
useWriteFileLock #
Accepts
Default
Since
Whether
_EX flag.
Some file systems, such as NFS, do not support exclusive file locking.
When set to 'auto', Craft will automatically try to detect if the underlying fil
e system supports exclusive file locking and cache the results.
'useWriteFileLock' => true,
useXSendFile #
Accepts
Default
Since
Whether
true or false
false
Craft 1.0
Craft should use XSendFile to serve files when possible.