Craft 3 Class Reference

Class craft\config\GeneralConfig

Inheritance
craft\config\GeneralConfig » yii\base\BaseObject
Implements
yii\base\Configurable
Available since version
3.0
Source Code
https://github.com/craftcms/cms/blob/master/src/config/GeneralConfig.php

General config class

Public Properties
Property Type Description Defined By
$actionTrigger string The URI segment Craft should look for when determining if the current request should first be routed to a controller action. craft\config\GeneralConfig
$activateAccountSuccessPath mixed The URI Craft should use upon successfully activating a user. craft\config\GeneralConfig
$addTrailingSlashesToUrls boolean Determines whether auto-generated URLs should have trailing slashes. craft\config\GeneralConfig
$aliases array Any custom Yii [aliases](http://www. craft\config\GeneralConfig
$allowSimilarTags boolean If this is set to true, then a tag name of "Proteines" will also match a tag name of "Protéines". craft\config\GeneralConfig
$allowUpdates boolean Whether to allow Craft and plugin updates in the Control Panel, and plugin installation in the Plugin Store. craft\config\GeneralConfig
$allowUppercaseInSlug boolean Whether or not to allow uppercase letters in the slug. craft\config\GeneralConfig
$allowedFileExtensions string[] List of file extensions that Craft will allow when a user is uploading files. craft\config\GeneralConfig
$autoLoginAfterAccountActivation boolean If set to true, will automatically log the user in after successful account activation. craft\config\GeneralConfig
$backupCommand string, null Craft will use the command line libraries pg_dump and mysqldump for backing up a database by default. craft\config\GeneralConfig
$backupOnUpdate boolean Whether Craft should create a database backup before running new migrations. craft\config\GeneralConfig
$baseCpUrl string, null Sets the base URL to the CP that Craft should use when generating CP-facing URLs. craft\config\GeneralConfig
$blowfishHashCost integer The higher the cost value, the longer it takes to generate a password hash and to verify against it. craft\config\GeneralConfig
$cacheDuration mixed The default length of time Craft will store data, RSS feed, and template caches. craft\config\GeneralConfig
$cacheElementQueries boolean Whether Craft should cache element queries that fall inside {% cache %} tags. craft\config\GeneralConfig
$convertFilenamesToAscii boolean If set to true, any uploaded file names will have multi-byte characters (Chinese, Japanese, etc. craft\config\GeneralConfig
$cooldownDuration mixed The amount of time a user must wait before re-attempting to log in after their account is locked due to too many failed login attempts. craft\config\GeneralConfig
$cpTrigger string The URI segment Craft should look for when determining if the current request should route to the CP rather than the front-end website. craft\config\GeneralConfig
$csrfTokenName string The name of CSRF token used for CSRF validation if $enableCsrfProtection is set to true. craft\config\GeneralConfig
$customAsciiCharMappings array Any custom ASCII character mappings. craft\config\GeneralConfig
$defaultCookieDomain string Used to set a custom domain on any cookies that Craft creates. craft\config\GeneralConfig
$defaultCpLanguage string, null Defines the default language the Control Panel should get set to if the logged-in user doesn't have a preferred language set. craft\config\GeneralConfig
$defaultDirMode mixed The default permission to be set for newly generated directories. craft\config\GeneralConfig
$defaultFileMode integer, null The default permission to be set for newly generated files. craft\config\GeneralConfig
$defaultImageQuality integer The quality level Craft will use when saving JPG and PNG files. craft\config\GeneralConfig
$defaultSearchTermOptions array The default options that should be applied to each search term. craft\config\GeneralConfig
$defaultTemplateExtensions string[] The template file extensions Craft will look for when matching a template path to a file on the front end. craft\config\GeneralConfig
$defaultTokenDuration mixed The default amount of time tokens can be used before expiring. craft\config\GeneralConfig
$defaultWeekStartDay integer The default day that new users should have set as their “Week Start Day”. craft\config\GeneralConfig
$deferPublicRegistrationPassword boolean By default, Craft will require a 'password' field to be submitted on front-end, public user registrations. craft\config\GeneralConfig
$devMode boolean Determines whether the system is in Dev Mode or not. craft\config\GeneralConfig
$elevatedSessionDuration mixed The amount of time a user’s elevated session will last, which is required for some sensitive actions (e.g. user group/permission assignment). craft\config\GeneralConfig
$enableCsrfCookie boolean Whether to use a cookie to persist the CSRF token if $enableCsrfProtection is enabled. craft\config\GeneralConfig
$enableCsrfProtection boolean Whether to enable CSRF protection via hidden form inputs for all forms submitted via Craft. craft\config\GeneralConfig
$enableTemplateCaching boolean Whether to enable Craft's template {% cache %} tag on a global basis. craft\config\GeneralConfig
$errorTemplatePrefix string The prefix that should be prepended to HTTP error status codes when determining the path to look for an error’s template. craft\config\GeneralConfig
$extraAllowedFileExtensions string[], null List of file extensions that will be merged into the $allowedFileExtensions config setting. craft\config\GeneralConfig
$filenameWordSeparator string, boolean The string to use to separate words when uploading Assets. craft\config\GeneralConfig
$generateTransformsBeforePageLoad boolean Whether transforms be generated before loading the page. craft\config\GeneralConfig
$imageDriver mixed By default Craft will auto-detect if Imagick is installed and fallback to GD if not. craft\config\GeneralConfig
$indexTemplateFilenames string[] The template filenames Craft will look for within a directory to represent the directory’s “index” template when matching a template path to a file on the front end. craft\config\GeneralConfig
$invalidLoginWindowDuration mixed The amount of time to track invalid login attempts for a user, for determining if Craft should lock an account. craft\config\GeneralConfig
$invalidUserTokenPath mixed The URI Craft should redirect to when user token validation fails. craft\config\GeneralConfig
$ipHeaders string[], null List of headers where proxies store the real client IP. craft\config\GeneralConfig
$isSystemOn boolean, null Whether the site is currently online or not. craft\config\GeneralConfig
$limitAutoSlugsToAscii boolean If set to true, the auto-generated slugs for an entry will strip any multi-byte characters (Chinese, Japanese, etc. craft\config\GeneralConfig
$loginPath mixed The URI Craft should use for user login. craft\config\GeneralConfig
$logoutPath mixed The URI Craft should use for user logout. craft\config\GeneralConfig
$maxCachedCloudImageSize integer The maximum dimension size to use when caching images from external sources to use in transforms. craft\config\GeneralConfig
$maxInvalidLogins integer The number of invalid login attempts Craft will allow within the specified duration before the account gets locked. craft\config\GeneralConfig
$maxSlugIncrement integer The highest number Craft will tack onto a slug in order to make it unique before giving up and throwing an error. craft\config\GeneralConfig
$maxUploadFileSize integer, string The maximum upload file size allowed. craft\config\GeneralConfig
$omitScriptNameInUrls boolean Whether generated URLs should omit 'index. craft\config\GeneralConfig
$optimizeImageFilesize boolean If set to true and Imagick is used, Craft will take advantage of Imagick's advanced options to reduce the final image size without losing quality significantly. craft\config\GeneralConfig
$pageTrigger string The string preceding a number which Craft will look for when determining if the current request is for a particular page in a paginated list of pages. craft\config\GeneralConfig
$pathParam string The query string param that Craft will check when determining the request's path. craft\config\GeneralConfig
$phpMaxMemoryLimit string The maximum amount of memory Craft will try to reserve during memory intensive operations such as zipping, unzipping and updating. craft\config\GeneralConfig
$phpSessionName string The name of the PHP session cookie. craft\config\GeneralConfig
$postCpLoginRedirect mixed The path that users should be redirected to after logging in from the Control Panel. craft\config\GeneralConfig
$postLoginRedirect mixed The path that users should be redirected to after logging in from the front-end site. craft\config\GeneralConfig
$postLogoutRedirect mixed The path that users should be redirected to after logging out from the front-end site. craft\config\GeneralConfig
$preserveExifData boolean Whether the EXIF data should be preserved when manipulating images. craft\config\GeneralConfig
$preserveImageColorProfiles boolean Whether the embedded Image Color Profile (ICC) should be preserved when manipulating images. craft\config\GeneralConfig
$preventUserEnumeration boolean When set to false and you go through the "forgot password" workflow on the control panel login page, for example, you get distinct messages saying if the username/email didn't exist or the email was successfully sent and to check your email for further instructions. craft\config\GeneralConfig
$privateTemplateTrigger string The template path segment prefix that should be used to identify "private" templates -- templates that aren't directly accessible via a matching URL. craft\config\GeneralConfig
$purgePendingUsersDuration mixed The amount of time to wait before Craft purges pending users from the system that have not activated. craft\config\GeneralConfig
$rememberUsernameDuration mixed The amount of time Craft will remember a username and pre-populate it on the CP login page. craft\config\GeneralConfig
$rememberedUserSessionDuration mixed The amount of time a user stays logged if “Remember Me” is checked on the login page. craft\config\GeneralConfig
$requireMatchingUserAgentForSession boolean Whether Craft should require a matching user agent string when restoring a user session from a cookie. craft\config\GeneralConfig
$requireUserAgentAndIpForSession boolean Whether Craft should require the existence of a user agent string and IP address when creating a new user session. craft\config\GeneralConfig
$resourceBasePath string The path to the root directory that should store published CP resources. craft\config\GeneralConfig
$resourceBaseUrl string The URL to the root directory that should store published CP resources. craft\config\GeneralConfig
$restoreCommand string, null Craft will use the command line libraries psql and mysql for restoring a database by default. craft\config\GeneralConfig
$rotateImagesOnUploadByExifData boolean Whether Craft should rotate images according to their EXIF data on upload. craft\config\GeneralConfig
$runQueueAutomatically boolean Whether Craft should run pending queue jobs automatically over HTTP requests. craft\config\GeneralConfig
$sanitizeSvgUploads boolean Whether Craft should sanitize uploaded SVG files and strip out potential malicious looking content. craft\config\GeneralConfig
$secureHeaders array, null Lists of headers that are, by default, subject to the trusted host configuration. craft\config\GeneralConfig
$secureProtocolHeaders array, null List of headers to check for determining whether the connection is made via HTTPS. craft\config\GeneralConfig
$securityKey string A private, random, cryptographically-secure key that is used for hashing and encrypting data in craft\services\Security. craft\config\GeneralConfig
$sendPoweredByHeader boolean Whether the X-Powered-By header should be sent on each request, helping clients identify that the site is powered by Craft. craft\config\GeneralConfig
$setPasswordPath mixed The URI Craft should use for user password resetting. craft\config\GeneralConfig
$setPasswordSuccessPath mixed The URI Craft should use upon successfully setting a users’s password. craft\config\GeneralConfig
$showBetaUpdates boolean Whether or not to show beta Craft updates from the updates page in the control panel. craft\config\GeneralConfig
$siteName string, string[] The site name(s). craft\config\GeneralConfig
$siteUrl string, string[] The base URL to the site(s). craft\config\GeneralConfig
$slugWordSeparator string The character(s) that should be used to separate words in slugs. craft\config\GeneralConfig
$suppressTemplateErrors boolean Controls whether or not to show or hide any Twig template runtime errors that occur on the site in the browser. craft\config\GeneralConfig
$testToEmailAddress string, array, null Configures Craft to send all system emails to a single email address, or an array of email addresses for testing purposes. craft\config\GeneralConfig
$timezone string, null The timezone of the site. craft\config\GeneralConfig
$tokenParam string The name of the 'token' query string parameter. craft\config\GeneralConfig
$translationDebugOutput boolean Tells Craft whether to surround all translatable strings with “@” symbols, to help find any strings that are not being run through Craft::t() or the |translate filter. craft\config\GeneralConfig
$trustedHosts array The configuration for trusted security-related headers. craft\config\GeneralConfig
$useCompressedJs boolean Tells Craft whether to use compressed JavaScript files whenever possible, to cut down on page load times. craft\config\GeneralConfig
$useEmailAsUsername boolean If set to true, Craft will use a user's email address in place of their username and remove username UI from the control panel. craft\config\GeneralConfig
$useFileLocks boolean, null Whether to grab an exclusive lock on a file when writing to it by using the LOCK_EX flag. craft\config\GeneralConfig
$usePathInfo boolean Whether Craft should specify the path using PATH_INFO or as a query string parameter when generating URLs. craft\config\GeneralConfig
$useSecureCookies boolean, string Determines whether Craft will set the "secure" flag when saving cookies when using Craft::cookieConfig() to create a cookie. craft\config\GeneralConfig
$useSslOnTokenizedUrls boolean, string Determines what protocol/schema Craft will use when generating tokenized URLs. craft\config\GeneralConfig
$useXSendFile boolean Whether Craft should use XSendFile to serve files when possible. craft\config\GeneralConfig
$userSessionDuration mixed The amount of time a user stays logged in. craft\config\GeneralConfig
$verificationCodeDuration mixed The amount of time a user verification code can be used before expiring. craft\config\GeneralConfig
Public Methods
Method Description Defined By
__call() Calls the named method which is not a class method. yii\base\BaseObject
__construct() Constructor. craft\config\GeneralConfig
__get() Returns the value of an object property. craft\config\GeneralConfig
__isset() Checks if a property is set, i.e. defined and not null. craft\config\GeneralConfig
__set() Sets value of an object property. craft\config\GeneralConfig
__unset() Sets an object property to null. yii\base\BaseObject
canGetProperty() Returns a value indicating whether a property can be read. yii\base\BaseObject
canSetProperty() Returns a value indicating whether a property can be set. yii\base\BaseObject
className() Returns the fully qualified name of this class. yii\base\BaseObject
getActivateAccountSuccessPath() Returns the localized Activate Account Success Path value. craft\config\GeneralConfig
getBackupOnUpdate() Returns whether the DB should be backed up before running new migrations. craft\config\GeneralConfig
getInvalidUserTokenPath() Returns the localized Invalid User Token Path value. craft\config\GeneralConfig
getLoginPath() Returns the localized Login Path value. craft\config\GeneralConfig
getLogoutPath() Returns the localized Logout Path value. craft\config\GeneralConfig
getPostCpLoginRedirect() Returns the localized Post-CP Login Redirect path. craft\config\GeneralConfig
getPostLoginRedirect() Returns the localized Post-Login Redirect path. craft\config\GeneralConfig
getPostLogoutRedirect() Returns the localized Post-Logout Redirect path. craft\config\GeneralConfig
getSetPasswordPath() Returns the localized Set Password Path value. craft\config\GeneralConfig
getSetPasswordSuccessPath() Returns the localized Set Password Success Path value. craft\config\GeneralConfig
hasMethod() Returns a value indicating whether a method is defined. yii\base\BaseObject
hasProperty() Returns a value indicating whether a property is defined. yii\base\BaseObject
init() Initializes the object. craft\config\GeneralConfig
Constants
Constant Value Description Defined By
IMAGE_DRIVER_AUTO 'auto' craft\config\GeneralConfig
IMAGE_DRIVER_GD 'gd' craft\config\GeneralConfig
IMAGE_DRIVER_IMAGICK 'imagick' craft\config\GeneralConfig

Property Details

$actionTrigger public property #

The URI segment Craft should look for when determining if the current request should first be routed to a controller action.

public string $actionTrigger 'actions'

$activateAccountSuccessPath public property #

The URI Craft should use upon successfully activating a user. Note that this only affects front-end site requests. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getActivateAccountSuccessPath().

public mixed $activateAccountSuccessPath ''

$addTrailingSlashesToUrls public property #

Determines whether auto-generated URLs should have trailing slashes.

public boolean $addTrailingSlashesToUrls false

$aliases public property #

Any custom Yii aliases that should be defined for every request.

public array $aliases = []

$allowSimilarTags public property #

If this is set to true, then a tag name of "Proteines" will also match a tag name of "Protéines". Otherwise, they are treated as the same tag. Note that this

public boolean $allowSimilarTags false

$allowUpdates public property #

Whether to allow Craft and plugin updates in the Control Panel, and plugin installation in the Plugin Store.

public boolean $allowUpdates true

$allowUppercaseInSlug public property #

Whether or not to allow uppercase letters in the slug.

public boolean $allowUppercaseInSlug false

$allowedFileExtensions public property #

List of file extensions that Craft will allow when a user is uploading files.

See also $extraAllowedFileExtensions.

public string[] $allowedFileExtensions = ['7z''aiff''asf''avi''bmp''csv''doc''docx''fla''flv''gif''gz''gzip''htm''html''jp2''jpeg''jpg''jpx''js''m2t''mid''mov''mp3''mp4''m4a''m4v''mpc''mpeg''mpg''ods''odt''ogg''ogv''pdf''png''potx''pps''ppsm''ppsx''ppt''pptm''pptx''ppz''pxd''qt''ram''rar''rm''rmi''rmvb''rtf''sdc''sitd''svg''swf''sxc''sxw''tar''tgz''tif''tiff''txt''vob''vsd''wav''webm''wma''wmv''xls''xlsx''zip']

$autoLoginAfterAccountActivation public property #

If set to true, will automatically log the user in after successful account activation.

public boolean $autoLoginAfterAccountActivation false

$backupCommand public property #

Craft will use the command line libraries pg_dump and mysqldump for backing up a database by default. It assumes that those libraries are in the $PATH variable for the user the web server is running as. If you want to use some other library, or want to specify an absolute path to them, or want to specify different parameters than the default, or you want to implement some other backup solution, you can override that behavior here. There are several tokens you can use that Craft will swap out at runtime:

* `{path}` - Swapped with the dynamically generated backup file path.
* `{port}` - Swapped with the current database port.
* `{server}` - Swapped with the current database host name.
* `{user}` - Swapped with the user to connect to the database.
* `{database}` - Swapped with the current database name.
* `{schema}` - Swapped with the current database schema (if any).

This can also be set to false to disable database backups completely.

public string, null $backupCommand null

$backupOnUpdate public property #

Whether Craft should create a database backup before running new migrations.

See also $backupCommand.

public boolean $backupOnUpdate true

$baseCpUrl public property #

Sets the base URL to the CP that Craft should use when generating CP-facing URLs. This will be determined automatically if left blank.

public string, null $baseCpUrl null

$blowfishHashCost public property #

The higher the cost value, the longer it takes to generate a password hash and to verify against it. Therefore, higher cost slows down a brute-force attack. For best protection against brute force attacks, set it to the highest value that is tolerable on production servers. The time taken to compute the hash doubles for every increment by one for this value. For example, if the hash takes 1 second to compute when the value is 14 then the compute time varies as 2^(value - 14) seconds.

public integer $blowfishHashCost 13

$cacheDuration public property #

The default length of time Craft will store data, RSS feed, and template caches. If set to 0, data and RSS feed caches will be stored indefinitely; template caches will be stored for one year. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $cacheDuration 86400

$cacheElementQueries public property #

Whether Craft should cache element queries that fall inside {% cache %} tags.

public boolean $cacheElementQueries true

$convertFilenamesToAscii public property #

If set to true, any uploaded file names will have multi-byte characters (Chinese, Japanese, etc.) stripped and any high-ASCII characters converted to their low ASCII counterparts (i.e. ñ → n).

public boolean $convertFilenamesToAscii false

$cooldownDuration public property #

The amount of time a user must wait before re-attempting to log in after their account is locked due to too many failed login attempts. Set to 0 to keep the account locked indefinitely, requiring an admin to manually unlock the account. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $cooldownDuration 300

$cpTrigger public property #

The URI segment Craft should look for when determining if the current request should route to the CP rather than the front-end website.

public string $cpTrigger 'admin'

$csrfTokenName public property #

The name of CSRF token used for CSRF validation if $enableCsrfProtection is set to true.

See also $enableCsrfProtection.

public string $csrfTokenName 'CRAFT_CSRF_TOKEN'

$customAsciiCharMappings public property #

Any custom ASCII character mappings. This array is merged into the default one in StringHelper::asciiCharMap(). The key is the ASCII character to be used for the replacement and the value is an array of non-ASCII characters that the key maps to. For example:

'c'    => ['ç', 'ć', 'č', 'ĉ', 'ċ']
public array $customAsciiCharMappings = []

$defaultCookieDomain public property #

Used to set a custom domain on any cookies that Craft creates. Defaults to an empty string, which leaves it up to the browser to determine which domain to use (almost always the current). If you want the cookies to work for all subdomains, for example, you could set this to '.domain.com'.

public string $defaultCookieDomain ''

$defaultCpLanguage public property #

Defines the default language the Control Panel should get set to if the logged-in user doesn't have a preferred language set.

public string, null $defaultCpLanguage null

$defaultDirMode public property #

The default permission to be set for newly generated directories. If set to null, the permission will be determined by the current environment.

public mixed $defaultDirMode 509

$defaultFileMode public property #

The default permission to be set for newly generated files. If set to null, the permission will be determined by the current environment.

public integer, null $defaultFileMode null

$defaultImageQuality public property #

The quality level Craft will use when saving JPG and PNG files. Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file).

public integer $defaultImageQuality 82

$defaultSearchTermOptions public property #

The default options that should be applied to each search term. Options include:

public array $defaultSearchTermOptions = ['attribute' => null'exact' => false'exclude' => false'subLeft' => false'subRight' => true]

$defaultTemplateExtensions public property #

The template file extensions Craft will look for when matching a template path to a file on the front end.

public string[] $defaultTemplateExtensions = ['html''twig']

$defaultTokenDuration public property #

The default amount of time tokens can be used before expiring. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $defaultTokenDuration 86400

$defaultWeekStartDay public property #

The default day that new users should have set as their “Week Start Day”. This should be set to an int from 0 to 6 where:

public integer $defaultWeekStartDay 0

$deferPublicRegistrationPassword public property #

By default, Craft will require a 'password' field to be submitted on front-end, public user registrations. Setting this to true will no longer require it on the initial registration form. If you have email verification enabled, the will set their password once they've clicked on the verification link in the email. If you don't, the only way they can set their password is to go through your "forgot password" workflow.

public boolean $deferPublicRegistrationPassword false

$devMode public property #

Determines whether the system is in Dev Mode or not.

public boolean $devMode false

$elevatedSessionDuration public property #

The amount of time a user’s elevated session will last, which is required for some sensitive actions (e.g. user group/permission assignment). Set to 0 to disable elevated session support. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $elevatedSessionDuration 300

$enableCsrfCookie public property #

Whether to use a cookie to persist the CSRF token if $enableCsrfProtection is enabled. If false, the CSRF token will be stored in session under the 'csrfTokenName' config setting name. Note that while storing CSRF tokens in session increases security, it requires starting a session for every page that a CSRF token is need, which may degrade site performance.

See also $enableCsrfProtection.

public boolean $enableCsrfCookie true

$enableCsrfProtection public property #

Whether to enable CSRF protection via hidden form inputs for all forms submitted via Craft.

See also:

public boolean $enableCsrfProtection true

$enableTemplateCaching public property #

Whether to enable Craft's template {% cache %} tag on a global basis.

See also http://craftcms.com/docs/templating/cache.

public boolean $enableTemplateCaching true

$errorTemplatePrefix public property #

The prefix that should be prepended to HTTP error status codes when determining the path to look for an error’s template. If set to '_', then your site’s 404 template would live at templates/_404.html, for example.

public string $errorTemplatePrefix ''

$extraAllowedFileExtensions public property #

List of file extensions that will be merged into the $allowedFileExtensions config setting.

See also $allowedFileExtensions.

public string[], null $extraAllowedFileExtensions null

$filenameWordSeparator public property #

The string to use to separate words when uploading Assets. If set to false, spaces will be left alone.

public string, boolean $filenameWordSeparator '-'

$generateTransformsBeforePageLoad public property #

Whether transforms be generated before loading the page.

public boolean $generateTransformsBeforePageLoad false

$imageDriver public property #

By default Craft will auto-detect if Imagick is installed and fallback to GD if not. You can explicitly set either 'imagick' or 'gd' here to override that behavior.

public mixed $imageDriver self::IMAGE_DRIVER_AUTO

$indexTemplateFilenames public property #

The template filenames Craft will look for within a directory to represent the directory’s “index” template when matching a template path to a file on the front end.

public string[] $indexTemplateFilenames = ['index']

$invalidLoginWindowDuration public property #

The amount of time to track invalid login attempts for a user, for determining if Craft should lock an account. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $invalidLoginWindowDuration 3600

$invalidUserTokenPath public property #

The URI Craft should redirect to when user token validation fails. A token is used on things like setting and resetting user account passwords. Note that this only affects front-end site requests. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getInvalidUserTokenPath().

public mixed $invalidUserTokenPath ''

$ipHeaders public property #

List of headers where proxies store the real client IP. See yii\web\Request::$ipHeaders for more details. If not set, the default craft\web\Request::$ipHeaders value will be used.

public string[], null $ipHeaders null

$isSystemOn public property #

Whether the site is currently online or not. If set to true or false, it will take precedence over the System Status setting in Settings → General.

public boolean, null $isSystemOn null

$limitAutoSlugsToAscii public property #

If set to true, the auto-generated slugs for an entry will strip any multi-byte characters (Chinese, Japanese, etc.) and attempt to convert any high-ASCII to their low ASCII counterparts (i.e. ñ → n). Note that this only affects the JavaScript auto-generated slugs and they still can be manually entered in the slug.

public boolean $limitAutoSlugsToAscii false

$loginPath public property #

The URI Craft should use for user login. Note that this only affects front-end site requests. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getLoginPath().

public mixed $loginPath 'login'

$logoutPath public property #

The URI Craft should use for user logout. Note that this only affects front-end site requests. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getLogoutPath().

public mixed $logoutPath 'logout'

$maxCachedCloudImageSize public property #

The maximum dimension size to use when caching images from external sources to use in transforms. Set to 0 to never cache them.

public integer $maxCachedCloudImageSize 2000

$maxInvalidLogins public property #

The number of invalid login attempts Craft will allow within the specified duration before the account gets locked.

public integer $maxInvalidLogins 5

$maxSlugIncrement public property #

The highest number Craft will tack onto a slug in order to make it unique before giving up and throwing an error.

public integer $maxSlugIncrement 100

$maxUploadFileSize public property #

The maximum upload file size allowed. See craft\helpers\ConfigHelper::sizeInBytes() for a list of supported value types.

public integer, string $maxUploadFileSize 16777216

$omitScriptNameInUrls public property #

Whether generated URLs should omit 'index.php', e.g. http://domain.com/path as opposed to showing it, e.g. http://domain.com/index.php/path This can only be possible if your server is configured to redirect would-be 404's to index.php, for example, with the redirect found in the 'htaccess' file that came with Craft:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+) /index.php?p=$1 [QSA,L]
public boolean $omitScriptNameInUrls false

$optimizeImageFilesize public property #

If set to true and Imagick is used, Craft will take advantage of Imagick's advanced options to reduce the final image size without losing quality significantly.

See also $imageDriver.

public boolean $optimizeImageFilesize true

$pageTrigger public property #

The string preceding a number which Craft will look for when determining if the current request is for a particular page in a paginated list of pages.

public string $pageTrigger 'p'

$pathParam public property #

The query string param that Craft will check when determining the request's path.

public string $pathParam 'p'

$phpMaxMemoryLimit public property #

The maximum amount of memory Craft will try to reserve during memory intensive operations such as zipping, unzipping and updating. Defaults to an empty string, which means it will use as much memory as it possibly can. See http://php.net/manual/en/faq.using.php#faq.using.shorthandbytes for a list of acceptable values.

public string $phpMaxMemoryLimit ''

$phpSessionName public property #

The name of the PHP session cookie.

See also https://php.net/manual/en/function.session-name.php.

public string $phpSessionName 'CraftSessionId'

$postCpLoginRedirect public property #

The path that users should be redirected to after logging in from the Control Panel. This setting will also come into effect if the user visits the CP’s Login page (/admin/login) or the CP’s root URL (/admin) when they are already logged in. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getPostCpLoginRedirect().

public mixed $postCpLoginRedirect 'dashboard'

$postLoginRedirect public property #

The path that users should be redirected to after logging in from the front-end site. This setting will also come into effect if the user visits the Login page (as specified by the loginPath config setting) when they are already logged in. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getPostLoginRedirect().

public mixed $postLoginRedirect ''

$postLogoutRedirect public property #

The path that users should be redirected to after logging out from the front-end site. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getPostLogoutRedirect().

public mixed $postLogoutRedirect ''

$preserveExifData public property #

Whether the EXIF data should be preserved when manipulating images. Setting this to false will reduce the image size a little bit, but all EXIF data will be cleared. This will only have effect if Imagick is in use.

public boolean $preserveExifData false

$preserveImageColorProfiles public property #

Whether the embedded Image Color Profile (ICC) should be preserved when manipulating images. Setting this to false will reduce the image size a little bit, but on some Imagick versions can cause images to be saved with an incorrect gamma value, which causes the images to become very dark. This will only have effect if Imagick is in use.

public boolean $preserveImageColorProfiles true

$preventUserEnumeration public property #

When set to false and you go through the "forgot password" workflow on the control panel login page, for example, you get distinct messages saying if the username/email didn't exist or the email was successfully sent and to check your email for further instructions. This can allow for username/email enumeration based on the response. If set true, you will always get a successful response even if there was an error making it difficult to enumerate users.

public boolean $preventUserEnumeration false

$privateTemplateTrigger public property #

The template path segment prefix that should be used to identify "private" templates -- templates that aren't directly accessible via a matching URL.

Set to an empty value to disable public template routing.

public string $privateTemplateTrigger '_'

$purgePendingUsersDuration public property #

The amount of time to wait before Craft purges pending users from the system that have not activated. Note that any content assigned to a pending user will be deleted as well when the given time interval passes. Set to 0 to disable this feature. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $purgePendingUsersDuration 0

$rememberUsernameDuration public property #

The amount of time Craft will remember a username and pre-populate it on the CP login page. Set to 0 to disable this feature altogether. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $rememberUsernameDuration 31536000

$rememberedUserSessionDuration public property #

The amount of time a user stays logged if “Remember Me” is checked on the login page. Set to 0 to disable the “Remember Me” feature altogether. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $rememberedUserSessionDuration 1209600

$requireMatchingUserAgentForSession public property #

Whether Craft should require a matching user agent string when restoring a user session from a cookie.

public boolean $requireMatchingUserAgentForSession true

$requireUserAgentAndIpForSession public property #

Whether Craft should require the existence of a user agent string and IP address when creating a new user session.

public boolean $requireUserAgentAndIpForSession true

$resourceBasePath public property #

The path to the root directory that should store published CP resources.

public string $resourceBasePath '@webroot/cpresources'

$resourceBaseUrl public property #

The URL to the root directory that should store published CP resources.

public string $resourceBaseUrl '@web/cpresources'

$restoreCommand public property #

Craft will use the command line libraries psql and mysql for restoring a database by default. It assumes that those libraries are in the $PATH variable for the user the web server is running as. If you want to use some other library, or want to specify an absolute path to them, or want to specify different parameters than the default, or you want to implement some other restoration solution, you can override that behavior here. There are several tokens you can use that Craft will swap out at runtime:

* `{path}` - Swapped with the dynamically generated backup file path.
* `{port}` - Swapped with the current database port.
* `{server}` - Swapped with the current database host name.
* `{user}` - Swapped with the user to connect to the database.
* `{database}` - Swapped with the current database name.
* `{schema}` - Swapped with the current database schema (if any).

This can also be set to false to disable database restores completely.

public string, null $restoreCommand null

$rotateImagesOnUploadByExifData public property #

Whether Craft should rotate images according to their EXIF data on upload.

public boolean $rotateImagesOnUploadByExifData true

$runQueueAutomatically public property #

Whether Craft should run pending queue jobs automatically over HTTP requests. This setting should be disabled for servers running Win32, or with Apache’s mod_deflate/mod_gzip installed, where PHP’s flush() method won’t work. If disabled, an alternate queue runner must be set up separately.

public boolean $runQueueAutomatically true

$sanitizeSvgUploads public property #

Whether Craft should sanitize uploaded SVG files and strip out potential malicious looking content. This should definitely be enabled if you are accepting SVG uploads from untrusted sources.

public boolean $sanitizeSvgUploads true

$secureHeaders public property #

Lists of headers that are, by default, subject to the trusted host configuration. See yii\web\Request::$secureHeaders for more details. If not set, the default yii\web\Request::$secureHeaders value will be used.

public array, null $secureHeaders null

$secureProtocolHeaders public property #

List of headers to check for determining whether the connection is made via HTTPS. See yii\web\Request::$secureProtocolHeaders for more details. If not set, the default yii\web\Request::$secureProtocolHeaders value will be used.

public array, null $secureProtocolHeaders null

$securityKey public property #

A private, random, cryptographically-secure key that is used for hashing and encrypting data in craft\services\Security. This value should be the same across all environments. Note that if this key ever changes, any data that was encrypted with it will be inaccessible.

public string $securityKey null

$sendPoweredByHeader public property #

Whether the X-Powered-By header should be sent on each request, helping clients identify that the site is powered by Craft.

public boolean $sendPoweredByHeader true

$setPasswordPath public property #

The URI Craft should use for user password resetting. Note that this only affects front-end site requests. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getSetPasswordPath().

public mixed $setPasswordPath 'setpassword'

$setPasswordSuccessPath public property #

The URI Craft should use upon successfully setting a users’s password. Note that this only affects front-end site requests. See craft\helpers\ConfigHelper::localizedValue() for a list of supported value types.

See also getSetPasswordSuccessPath().

public mixed $setPasswordSuccessPath ''

$showBetaUpdates public property #

Whether or not to show beta Craft updates from the updates page in the control panel. It is highly recommended that you do not use beta releases of Craft in a production environment.

public boolean $showBetaUpdates false

$siteName public property #

The site name(s). If set, it will take precedence over the Name settings in Settings → Sites → [Site Name]. This can be set to a string, which will override the primary site’s name only, or an array with site handles used as the keys.

public string, string[] $siteName null

$siteUrl public property #

The base URL to the site(s). If set, it will take precedence over the Base URL settings in Settings → Sites → [Site Name]. This can be set to a string, which will override the primary site’s base URL only, or an array with site handles used as the keys. The URL(s) must begin with either http://, https://, or // (protocol-relative).

public string, string[] $siteUrl null

$slugWordSeparator public property #

The character(s) that should be used to separate words in slugs.

public string $slugWordSeparator '-'

$suppressTemplateErrors public property #

Controls whether or not to show or hide any Twig template runtime errors that occur on the site in the browser. If it is set to true, the errors will still be logged to Craft’s log files.

public boolean $suppressTemplateErrors false

$testToEmailAddress public property #

Configures Craft to send all system emails to a single email address, or an array of email addresses for testing purposes. By default the recipient name(s) will be “Test Recipient”, but you can customize that by setting the value with the format ['email@address.com' => 'Name'].

public string, array, null $testToEmailAddress null

$timezone public property #

The timezone of the site. If set, it will take precedence over the Timezone setting in Settings → General. This can be set to one of PHP’s supported timezones (http://php.net/manual/en/timezones.php).

public string, null $timezone null

$tokenParam public property #

The name of the 'token' query string parameter.

public string $tokenParam 'token'

$translationDebugOutput public property #

Tells Craft whether to surround all translatable strings with “@” symbols, to help find any strings that are not being run through Craft::t() or the |translate filter.

public boolean $translationDebugOutput false

$trustedHosts public property #

The configuration for trusted security-related headers. See yii\web\Request::$trustedHosts for more details. By default, all hosts are trusted.

public array $trustedHosts = ['any']

$useCompressedJs public property #

Tells Craft whether to use compressed JavaScript files whenever possible, to cut down on page load times.

public boolean $useCompressedJs true

$useEmailAsUsername public property #

If set to true, Craft will use a user's email address in place of their username and remove username UI from the control panel.

public boolean $useEmailAsUsername false

$useFileLocks public property #

Whether to grab an exclusive lock on a file when writing to it by using the LOCK_EX flag. Some file systems, such as NFS, do not support exclusive file locking. If not set to true or false, Craft will automatically try to detect if the underlying file system supports exclusive file locking and cache the results.

See also http://php.net/manual/en/function.file-put-contents.php.

public boolean, null $useFileLocks null

$usePathInfo public property #

Whether Craft should specify the path using PATH_INFO or as a query string parameter when generating URLs. Note that this setting only takes effect if $omitScriptNameInUrls is set to false.

public boolean $usePathInfo false

$useSecureCookies public property #

Determines whether Craft will set the "secure" flag when saving cookies when using Craft::cookieConfig() to create a cookie. Valid values are true, false, and 'auto'. Defaults to 'auto', which will set the secure flag if the page you're currently accessing is over https://. true will always set the flag, regardless of protocol and false will never automatically set the flag.

public boolean, string $useSecureCookies 'auto'

$useSslOnTokenizedUrls public property #

Determines what protocol/schema Craft will use when generating tokenized URLs. If set to 'auto', Craft will check the siteUrl and the protocol of the current request and if either of them are https will use https in the tokenized URL. If not, will use http. If set to false, the Craft will always use http. If set to true, then, Craft will always use https.

public boolean, string $useSslOnTokenizedUrls 'auto'

$useXSendFile public property #

Whether Craft should use XSendFile to serve files when possible.

public boolean $useXSendFile false

$userSessionDuration public property #

The amount of time a user stays logged in. Set to 0 if you want users to stay logged in as long as their browser is open rather than a predetermined amount of time. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $userSessionDuration 3600

$verificationCodeDuration public property #

The amount of time a user verification code can be used before expiring. See craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types.

public mixed $verificationCodeDuration 86400

Method Details

__construct() public method #

Constructor.

The default implementation does two things:

If this method is overridden in a child class, it is recommended that

public void __construct ( array $config = [] )
$config array Name-value pairs that will be used to initialize the object properties

__get() public method #

Returns the value of an object property.

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing $value = $object->property;.

public mixed __get ( $name )
$name string The property name
return mixed The property value
throws yii\base\UnknownPropertyException if the property is not defined
throws yii\base\InvalidCallException if the property is write-only

__isset() public method #

Checks if a property is set, i.e. defined and not null.

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing isset($object->property).

Note that if the property is not defined, false will be returned.

public boolean __isset ( $name )
$name string The property name or the event name
return boolean Whether the named property is set (not null).

__set() public method #

Sets value of an object property.

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing $object->property = $value;.

public void __set ( $name, $value )
$name string The property name or the event name
$value mixed The property value
throws yii\base\UnknownPropertyException if the property is not defined
throws yii\base\InvalidCallException if the property is read-only

getActivateAccountSuccessPath() public method #

Returns the localized Activate Account Success Path value.

See also $activateAccountSuccessPath.

public string getActivateAccountSuccessPath ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

getBackupOnUpdate() public method #

Returns whether the DB should be backed up before running new migrations.

public boolean getBackupOnUpdate ( )

getInvalidUserTokenPath() public method #

Returns the localized Invalid User Token Path value.

See also $invalidUserTokenPath.

public string getInvalidUserTokenPath ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

getLoginPath() public method #

Returns the localized Login Path value.

See also $loginPath.

public string getLoginPath ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

getLogoutPath() public method #

Returns the localized Logout Path value.

See also $logoutPath.

public string getLogoutPath ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

getPostCpLoginRedirect() public method #

Returns the localized Post-CP Login Redirect path.

See also $postCpLoginRedirect.

public string getPostCpLoginRedirect ( )

getPostLoginRedirect() public method #

Returns the localized Post-Login Redirect path.

See also $postLoginRedirect.

public string getPostLoginRedirect ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

getPostLogoutRedirect() public method #

Returns the localized Post-Logout Redirect path.

See also $postLogoutRedirect.

public string getPostLogoutRedirect ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

getSetPasswordPath() public method #

Returns the localized Set Password Path value.

See also $setPasswordPath.

public string getSetPasswordPath ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

getSetPasswordSuccessPath() public method #

Returns the localized Set Password Success Path value.

See also $setPasswordSuccessPath.

public string getSetPasswordSuccessPath ( \craft\config\string $siteHandle null )
$siteHandle string, null The site handle the value should be defined for. Defaults to the current site.

init() public method #

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

public void init ( )