App

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\App
Since
3.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.
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.
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.
phpVersion()Returns the PHP version, without the distribution info.
sessionConfig()Returns the session component config for web requests.
userConfig()Returns the user component config for web requests.
viewConfig()Returns the view component config.
webRequestConfig()Returns the request component config for web requests.

assetManagerConfig()

Returns the assetManager component config for web requests.

View source

Returns

array

Signature

public static array assetManagerConfig ( )

backtrace()

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)

Signature

public static void backtrace ( \craft\helpers\int $limit = 0 )

cacheConfig()

Returns the cache component config.

View source

Returns

array

Signature

public static array cacheConfig ( )

checkForValidIconv()

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

View source

Returns

boolean

Signature

public static boolean checkForValidIconv ( )

dbConfig()

Returns the db component config.

View source

Arguments

Returns

array

Signature

public static array dbConfig ( craft\config\DbConfig $dbConfig = null )

editionName()

Returns the name of the given Craft edition.

View source

Arguments

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

Returns

string – The edition’s name.

Signature

public static string editionName ( \craft\helpers\int $edition )

editions()

Returns an array of all known Craft editions’ IDs.

View source

Returns

array – All the known Craft editions’ IDs.

Signature

public static array editions ( )

extensionVersion()

Returns a PHP extension version, without the distribution info.

View source

Arguments

  • $name (string) – The extension name

Returns

string

Signature

public static string extensionVersion ( \craft\helpers\string $name )

humanizeClass()

Returns a humanized class name.

View source

Arguments

Returns

string

Signature

public static string humanizeClass ( \craft\helpers\string $class )

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.

Signature

public static boolean isValidEdition ( $edition )

licenseKey()

Signature

public static string, null licenseKey ( )

logConfig()

Returns the log component config.

View source

Returns

array, null

Signature

public static array, null logConfig ( )

mailerConfig()

Returns the mailer component config.

View source

Arguments

Returns

array

Signature

public static array mailerConfig ( craft\models\MailSettings $settings = null )

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

Signature

public static void maxPowerCaptain ( )

mutexConfig()

Returns the mutex component config.

View source

Returns

array

Signature

public static array mutexConfig ( )

normalizeVersion()

Removes distribution info from a version

View source

Arguments

Returns

string

Signature

public static string normalizeVersion ( \craft\helpers\string $version )

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.

Signature

public static boolean phpConfigValueAsBool ( \craft\helpers\string $var )

phpVersion()

Returns the PHP version, without the distribution info.

View source

Returns

string

Signature

public static string phpVersion ( )

sessionConfig()

Returns the session component config for web requests.

View source

Returns

array

Signature

public static array sessionConfig ( )

userConfig()

Returns the user component config for web requests.

View source

Returns

array

Signature

public static array userConfig ( )

viewConfig()

Returns the view component config.

View source

Returns

array

Signature

public static array viewConfig ( )

webRequestConfig()

Returns the request component config for web requests.

View source

Returns

array

Signature

public static array webRequestConfig ( )