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) : mixed

Constructor.

Parameters

string $name

Name

Returns

mixed —

get()

get(string  $addon) : \rex_addon_interface

Returns the addon by the given name.

Parameters

string $addon

Name of the addon

Throws

\InvalidArgumentException

Returns

\rex_addon_interface —

If the addon exists, a rex_addon is returned, otherwise a rex_null_addon

require()

require(string  $addon) : self

Returns the addon by the given name.

Parameters

string $addon

Throws

\RuntimeException

if the addon does not exist

Returns

self —

exists()

exists(string  $addon) : bool

Returns if the addon exists.

Parameters

string $addon

Name of the addon

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

{@inheritdoc}

Returns

mixed —

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 —

getPlugin()

getPlugin(mixed  $plugin) : \rex_plugin_interface

Returns the child plugin by the given name.

Parameters

mixed $plugin

Name of the plugin

Returns

\rex_plugin_interface —

requirePlugin()

requirePlugin(string  $plugin) : \rex_plugin

Returns the child plugin by the given name.

Parameters

string $plugin

Throws

\RuntimeException

if the plugin does not exist

Returns

\rex_plugin —

pluginExists()

pluginExists(mixed  $plugin) : bool

Returns if the plugin exists.

Parameters

mixed $plugin

Name of the plugin

Returns

bool —

getRegisteredPlugins()

getRegisteredPlugins() : \rex_plugin[]

Returns the registered plugins.

Returns

\rex_plugin[] —

getInstalledPlugins()

getInstalledPlugins() : \rex_plugin[]

Returns the installed plugins.

Returns

\rex_plugin[] —

getAvailablePlugins()

getAvailablePlugins() : \rex_plugin[]

Returns the available plugins.

Returns

\rex_plugin[] —

getSystemPlugins()

getSystemPlugins() : \rex_plugin[]

Returns the system plugins.

Returns

\rex_plugin[] —

getRegisteredAddons()

getRegisteredAddons() : self[]

Returns the registered addons.

Returns

self[] —

getInstalledAddons()

getInstalledAddons() : self[]

Returns the installed addons.

Returns

self[] —

getAvailableAddons()

getAvailableAddons() : self[]

Returns the available addons.

Returns

self[] —

getSetupAddons()

getSetupAddons() : self[]

Returns the setup addons.

Returns

self[] —

getSystemAddons()

getSystemAddons() : self[]

Returns the system addons.

Returns

self[] —

initialize()

initialize(mixed  $dbExists = true) : mixed

Initializes all packages.

Parameters

mixed $dbExists

Returns

mixed —