\rex_null_package

Represents a null package.

Instances of this class are returned by rex_package::get() for non-existing packages. Thereby it is safe to call rex_package::get(...)->isAvailable() and isInstalled(). Other methods should not be called on null-packages since they do not return useful values. Some methods like getPath() throw exceptions.

Summary

Methods
Properties
Constants
getInstance()
__clone()
getName()
getAddon()
getPackageId()
getPath()
getAssetsPath()
getAssetsUrl()
getDataPath()
getCachePath()
setConfig()
getConfig()
hasConfig()
removeConfig()
setProperty()
getProperty()
hasProperty()
removeProperty()
isAvailable()
isInstalled()
isSystemPackage()
getAuthor()
getVersion()
getSupportPage()
includeFile()
i18n()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getInstance()

getInstance() : static

Returns the singleton instance.

Returns

static —

__clone()

__clone() : mixed

Cloning a singleton is not allowed.

Throws

\BadMethodCallException

Returns

mixed —

getName()

getName() : string

Returns the name of the package.

Returns

string —

Name

getAddon()

getAddon() : \rex_null_addon

Returns the related Addon.

Returns

\rex_null_addon —

getPackageId()

getPackageId() : string|null

Returns the package ID.

Returns

string|null —

getPath()

getPath(mixed  $file = '') : string

Returns the base path.

Parameters

mixed $file

File

Returns

string —

getAssetsPath()

getAssetsPath(mixed  $file = '') : string

Returns the assets path.

Parameters

mixed $file

File

Returns

string —

getAssetsUrl()

getAssetsUrl(mixed  $file = '') : string

Returns the assets url.

Parameters

mixed $file

File

Returns

string —

getDataPath()

getDataPath(mixed  $file = '') : string

Returns the data path.

Parameters

mixed $file

File

Returns

string —

getCachePath()

getCachePath(mixed  $file = '') : string

Returns the cache path.

Parameters

mixed $file

File

Returns

string —

setConfig()

setConfig(mixed  $key, mixed  $value = null) : mixed

Parameters

mixed $key
mixed $value

Returns

mixed —

getConfig()

getConfig(mixed  $key = null, mixed  $default = null) : mixed

Parameters

mixed $key
mixed $default

Returns

mixed —

hasConfig()

hasConfig(mixed  $key = null) : mixed

Parameters

mixed $key

Returns

mixed —

removeConfig()

removeConfig(mixed  $key) : mixed

Parameters

mixed $key

Returns

mixed —

setProperty()

setProperty(mixed  $key, mixed  $value) : mixed

Sets a property.

Parameters

mixed $key

Key of the property

mixed $value

New value for the property

Returns

mixed —

getProperty()

getProperty(mixed  $key, mixed  $default = null) : mixed

Returns a property.

Parameters

mixed $key

Key of the property

mixed $default

Default value, will be returned if the property isn't set

Returns

mixed —

hasProperty()

hasProperty(mixed  $key) : bool

Returns if a property is set.

Parameters

mixed $key

Key of the property

Returns

bool —

removeProperty()

removeProperty(mixed  $key) : mixed

Removes a property.

Parameters

mixed $key

Key of the property

Returns

mixed —

isAvailable()

isAvailable() : bool

Returns if the package is available (activated and installed).

Returns

bool —

isInstalled()

isInstalled() : bool

Returns if the package is installed.

Returns

bool —

isSystemPackage()

isSystemPackage() : bool

Returns if it is a system package.

Returns

bool —

getAuthor()

getAuthor(mixed  $default = null) : string|null

Returns the author.

Parameters

mixed $default

Default value, will be returned if the property isn't set

Returns

string|null —

getVersion()

getVersion(mixed  $format = null) : string

Returns the version.

Parameters

mixed $format

See {@link}

Returns

string —

getSupportPage()

getSupportPage(mixed  $default = null) : string|null

Returns the supportpage.

Parameters

mixed $default

Default value, will be returned if the property isn't set

Returns

string|null —

includeFile()

includeFile(mixed  $file, array  $context = []) : mixed

Includes a file in the package context.

Parameters

mixed $file

Filename

array $context

Context values, available as variables in given file

Returns

mixed —

i18n()

i18n(mixed  $key, mixed  ...$replacements) : string

Adds the package prefix to the given key and returns the translation for it.

Parameters

mixed $key

Key

mixed $replacements variadic

A arbritary number of strings used for interpolating within the resolved messag

Returns

string —

Translation for the key