App

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\App
Since
3.0.0

App helper.

View source

Public Methods

MethodDescription
assetManagerConfig()Returns the assetManager component config for web requests.
backtrace()Returns the backtrace as a string (omitting the final frame where this method was called).
cacheConfig()Returns the cache component config.
checkForValidIconv()Returns whether the server has a valid version of the iconv extension installed.
dbConfig()Returns the db component config.
editionHandle()Returns the handle of the given Craft edition.
editionIdByHandle()Returns the ID of a Craft edition by its handle.
editionName()Returns the name of the given Craft edition.
editions()Returns an array of all known Craft editions’ IDs.
extensionVersion()Returns a PHP extension version, without the distribution info.
humanizeClass()Returns a humanized class name.
isValidEdition()Returns whether an edition is valid.
licenseKey()
logConfig()Returns the log component config.
mailSettings()Returns the system email settings.
mailerConfig()Returns the mailer component config.
maxPowerCaptain()Sets PHP’s memory limit to the maximum specified by the phpMaxMemoryLimit config setting, and gives the script an unlimited amount of time to execute.
mutexConfig()Returns the mutex component config.
normalizeVersion()Removes distribution info from a version
phpConfigValueAsBool()Retrieves a bool PHP config setting and normalizes it to an actual bool.
phpConfigValueInBytes()Retrieves a disk size PHP config setting and normalizes it into bytes.
phpVersion()Returns the PHP version, without the distribution info.
projectConfigConfig()Returns the projectConfig component config.
sessionConfig()Returns the session component config for web requests.
testIniSet()Tests whether ini_set() works.
userConfig()Returns the user component config for web requests.
viewConfig()Returns the view component config.
webRequestConfig()Returns the request component config for web requests.
webResponseConfig()Returns the response component config for web requests.

assetManagerConfig()

Since
3.0.18

Returns the assetManager component config for web requests.

View source

Returns

array

backtrace()

Since
3.0.13

Returns the backtrace as a string (omitting the final frame where this method was called).

View source

Arguments

  • $limit (integer) – The max number of stack frames to be included (0 means no limit)

Returns

string

cacheConfig()

Since
3.0.18

Returns the cache component config.

View source

Returns

array

checkForValidIconv()

Returns whether the server has a valid version of the iconv extension installed.

View source

Returns

boolean

dbConfig()

Since
3.0.18

Returns the db component config.

View source

Arguments

Returns

array

editionHandle()

Since
3.1.0

Returns the handle of the given Craft edition.

View source

Arguments

  • $edition (integer) – An edition’s ID.

Returns

string – The edition’s name.

editionIdByHandle()

Since
3.1.0

Returns the ID of a Craft edition by its handle.

View source

Arguments

  • $handle (string) – An edition’s handle

Returns

integer – The edition’s ID

Throws

editionName()

Returns the name of the given Craft edition.

View source

Arguments

  • $edition (integer) – An edition’s ID.

Returns

string – The edition’s name.

editions()

Returns an array of all known Craft editions’ IDs.

View source

Returns

array – All the known Craft editions’ IDs.

extensionVersion()

Returns a PHP extension version, without the distribution info.

View source

Arguments

  • $name (string) – The extension name

Returns

string

humanizeClass()

Returns a humanized class name.

View source

Arguments

Returns

string

isValidEdition()

Returns whether an edition is valid.

View source

Arguments

  • $edition (mixed) – An edition’s ID (or is it?)

Returns

boolean – Whether $edition is a valid edition ID.

licenseKey()

View source

Returns

string, null

logConfig()

Since
3.0.18

Returns the log component config.

View source

Returns

array, null

mailSettings()

Since
3.1.0

Returns the system email settings.

View source

Returns

craft\models\MailSettings

mailerConfig()

Since
3.0.18

Returns the mailer component config.

View source

Arguments

Returns

array

maxPowerCaptain()

Sets PHP’s memory limit to the maximum specified by the phpMaxMemoryLimit config setting, and gives the script an unlimited amount of time to execute.

View source

mutexConfig()

Since
3.0.18

Returns the mutex component config.

View source

Returns

array

normalizeVersion()

Removes distribution info from a version

View source

Arguments

Returns

string

phpConfigValueAsBool()

Retrieves a bool PHP config setting and normalizes it to an actual bool.

View source

Arguments

  • $var (string) – The PHP config setting to retrieve.

Returns

boolean – Whether it is set to the php.ini equivelant of true.

phpConfigValueInBytes()

Since
3.0.38

Retrieves a disk size PHP config setting and normalizes it into bytes.

View source

Arguments

  • $var (string) – The PHP config setting to retrieve.

Returns

integer, float – The value normalized into bytes.

phpVersion()

Returns the PHP version, without the distribution info.

View source

Returns

string

projectConfigConfig()

Returns the projectConfig component config.

View source

sessionConfig()

Since
3.0.18

Returns the session component config for web requests.

View source

Returns

array

testIniSet()

Since
3.0.40

Tests whether ini_set() works.

View source

Returns

boolean

userConfig()

Since
3.0.18

Returns the user component config for web requests.

View source

Returns

array

viewConfig()

Since
3.0.18

Returns the view component config.

View source

Returns

array

webRequestConfig()

Since
3.0.18

Returns the request component config for web requests.

View source

Returns

array

webResponseConfig()

Since
3.3.0

Returns the response component config for web requests.

View source

Returns

array