App

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

App helper.

View source

Public Methods

MethodDescription
backtrace()Returns the backtrace as a string (omitting the final frame where this method was called).
checkForValidIconv()Returns whether the server has a valid version of the iconv extension installed.
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()
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.
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.

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 )

checkForValidIconv()

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

View source

Returns

boolean

Signature

public static boolean checkForValidIconv ( )

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 ( )

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 ( )

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 ( )