Constants

FILE_PACKAGE

FILE_PACKAGE = 'package.yml'

FILE_BOOT

FILE_BOOT = 'boot.php'

FILE_INSTALL

FILE_INSTALL = 'install.php'

FILE_INSTALL_SQL

FILE_INSTALL_SQL = 'install.sql'

FILE_UNINSTALL

FILE_UNINSTALL = 'uninstall.php'

FILE_UNINSTALL_SQL

FILE_UNINSTALL_SQL = 'uninstall.sql'

FILE_UPDATE

FILE_UPDATE = 'update.php'

Methods

__construct()

__construct(string  $name, \rex_addon  $addon) : mixed

Constructor.

Parameters

string $name

Name

\rex_addon $addon

Parent addon

Returns

mixed —

get()

get(string  $addon, string  $plugin = null) : \rex_plugin_interface

Returns the plugin by the given name.

Parameters

string $addon

Name of the addon

string $plugin

Name of the plugin

Throws

\InvalidArgumentException

Returns

\rex_plugin_interface —

If the plugin exists, a rex_plugin is returned, otherwise a rex_null_plugin

require()

require(string  $addon, string  $plugin = null) : self

Returns the plugin by the given name.

Parameters

string $addon
string $plugin

Throws

\RuntimeException

if the plugin does not exist

Returns

self —

exists()

exists(string  $addon, string  $plugin = null) : bool

Returns if the plugin exists.

Parameters

string $addon

Name of the addon

string $plugin

Name of the plugin

Returns

bool —

splitId()

splitId(string  $packageId) : array

Splits the package id into a tuple of addon id and plugin id (if existing).

Parameters

string $packageId

Returns

array —

getPackageId()

getPackageId() : string

Returns the package ID.

Returns

string —

getName()

getName() : string

Returns the name of the package.

Returns

string —

Name

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 —

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 —

loadProperties()

loadProperties() : mixed

Loads the properties of package.yml.

Returns

mixed —

clearCache()

clearCache() : mixed

Clears the cache of the package.

Throws

\rex_functional_exception

Returns

mixed —

enlist()

enlist() : mixed

Returns

mixed —

boot()

boot() : mixed

Returns

mixed —

getRegisteredPackages()

getRegisteredPackages() : self[]

Returns the registered packages.

Returns

self[] —

getInstalledPackages()

getInstalledPackages() : self[]

Returns the installed packages.

Returns

self[] —

getAvailablePackages()

getAvailablePackages() : self[]

Returns the available packages.

Returns

self[] —

getSetupPackages()

getSetupPackages() : self[]

Returns the setup packages.

Returns

self[] —

getSystemPackages()

getSystemPackages() : self[]

Returns the system packages.

Returns

self[] —

getAddon()

getAddon() : \rex_addon

{@inheritdoc}

Returns

\rex_addon —

getType()

getType() : mixed

{@inheritdoc}

Returns

mixed —

getPath()

getPath(mixed  $file = '') : mixed

{@inheritdoc}

Parameters

mixed $file

Returns

mixed —

getAssetsPath()

getAssetsPath(mixed  $file = '') : mixed

{@inheritdoc}

Parameters

mixed $file

Returns

mixed —

getAssetsUrl()

getAssetsUrl(mixed  $file = '') : mixed

{@inheritdoc}

Parameters

mixed $file

Returns

mixed —

getDataPath()

getDataPath(mixed  $file = '') : mixed

{@inheritdoc}

Parameters

mixed $file

Returns

mixed —

getCachePath()

getCachePath(mixed  $file = '') : mixed

{@inheritdoc}

Parameters

mixed $file

Returns

mixed —

isSystemPackage()

isSystemPackage() : mixed

{@inheritdoc}

Returns

mixed —

i18n()

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

{@inheritdoc}

Parameters

mixed $key
mixed $replacements variadic

Returns

mixed —

getRegisteredPlugins()

getRegisteredPlugins(string  $addon) : self[]

Returns the registered plugins of the given addon.

Parameters

string $addon

Addon name

Returns

self[] —

getInstalledPlugins()

getInstalledPlugins(string  $addon) : self[]

Returns the installed plugins of the given addons.

Parameters

string $addon

Addon name

Returns

self[] —

getAvailablePlugins()

getAvailablePlugins(string  $addon) : self[]

Returns the available plugins of the given addons.

Parameters

string $addon

Addon name

Returns

self[] —

getSystemPlugins()

getSystemPlugins(string  $addon) : self[]

Returns the system plugins of the given addons.

Parameters

string $addon

Addon name

Returns

self[] —