rex_package_interface
in
Interface for packages.
Tags
Table of Contents
Methods
- getAddon() : rex_addon_interface
- Returns the related Addon.
- getAssetsPath() : non-empty-string
- Returns the assets path.
- getAssetsUrl() : non-empty-string
- Returns the assets url.
- getAuthor() : string|null
- Returns the author.
- getCachePath() : non-empty-string
- Returns the cache path.
- getConfig() : mixed
- getDataPath() : non-empty-string
- Returns the data path.
- getName() : non-empty-string
- Returns the name of the package.
- getPackageId() : non-empty-string|null
- Returns the package ID.
- getPath() : non-empty-string
- Returns the base path.
- getProperty() : mixed
- Returns a property.
- getSupportPage() : string|null
- Returns the supportpage.
- getType() : "addon"|"plugin"
- Returns the package type as string.
- getVersion() : string
- Returns the version.
- hasConfig() : bool
- hasProperty() : bool
- Returns if a property is set.
- i18n() : non-empty-string
- Adds the package prefix to the given key and returns the translation for it.
- includeFile() : mixed
- Includes a file in the package context.
- isAvailable() : bool
- Returns if the package is available (activated and installed).
- isInstalled() : bool
- Returns if the package is installed.
- isSystemPackage() : bool
- Returns if it is a system package.
- removeConfig() : bool
- removeProperty() : void
- Removes a property.
- setConfig() : bool
- setProperty() : void
- Sets a property.
Methods
getAddon()
Returns the related Addon.
public
getAddon() : rex_addon_interface
Return values
rex_addon_interfacegetAssetsPath()
Returns the assets path.
public
getAssetsPath([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringgetAssetsUrl()
Returns the assets url.
public
getAssetsUrl([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringgetAuthor()
Returns the author.
public
getAuthor([string|null $default = null ]) : string|null
Parameters
- $default : string|null = null
-
Default value, will be returned if the property isn't set
Return values
string|nullgetCachePath()
Returns the cache path.
public
getCachePath([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringgetConfig()
public
getConfig([T $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : T = null
-
The associated key
- $default : mixed = null
-
Default return value if no associated-value can be found
Tags
Return values
mixed —the value for $key or $default if $key cannot be found in the given $namespace
getDataPath()
Returns the data path.
public
getDataPath([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringgetName()
Returns the name of the package.
public
getName() : non-empty-string
Return values
non-empty-string —Name
getPackageId()
Returns the package ID.
public
getPackageId() : non-empty-string|null
Return values
non-empty-string|nullgetPath()
Returns the base path.
public
getPath([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringgetProperty()
Returns a property.
public
getProperty(non-empty-string $key[, mixed $default = null ]) : mixed
Parameters
- $key : non-empty-string
-
Key of the property
- $default : mixed = null
-
Default value, will be returned if the property isn't set
getSupportPage()
Returns the supportpage.
public
getSupportPage([string|null $default = null ]) : string|null
Parameters
- $default : string|null = null
-
Default value, will be returned if the property isn't set
Return values
string|nullgetType()
Returns the package type as string.
public
getType() : "addon"|"plugin"
Return values
"addon"|"plugin"getVersion()
Returns the version.
public
getVersion([string $format = null ]) : string
Parameters
Return values
stringhasConfig()
public
hasConfig([string|null $key = null ]) : bool
Parameters
- $key : string|null = null
-
The associated key
Tags
Return values
boolhasProperty()
Returns if a property is set.
public
hasProperty(non-empty-string $key) : bool
Parameters
- $key : non-empty-string
-
Key of the property
Return values
booli18n()
Adds the package prefix to the given key and returns the translation for it.
public
i18n(string $key, string|int ...$replacements) : non-empty-string
Parameters
- $key : string
-
Key
- $replacements : string|int
-
A arbritary number of strings used for interpolating within the resolved messag
Return values
non-empty-string —Translation for the key
includeFile()
Includes a file in the package context.
public
includeFile(non-empty-string $file[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $file : non-empty-string
-
Filename
- $context : array<string|int, mixed> = []
-
Context values, available as variables in given file
isAvailable()
Returns if the package is available (activated and installed).
public
isAvailable() : bool
Return values
boolisInstalled()
Returns if the package is installed.
public
isInstalled() : bool
Return values
boolisSystemPackage()
Returns if it is a system package.
public
isSystemPackage() : bool
Return values
boolremoveConfig()
public
removeConfig(string $key) : bool
Parameters
- $key : string
-
The associated key
Tags
Return values
boolremoveProperty()
Removes a property.
public
removeProperty(non-empty-string $key) : void
Parameters
- $key : non-empty-string
-
Key of the property
setConfig()
public
setConfig(string|array<string, mixed> $key[, mixed $value = null ]) : bool
Parameters
- $key : string|array<string, mixed>
-
The associated key or an associative array of key/value pairs
- $value : mixed = null
-
The value to save
Tags
Return values
bool —TRUE when an existing value was overridden, otherwise FALSE
setProperty()
Sets a property.
public
setProperty(non-empty-string $key, mixed $value) : void
Parameters
- $key : non-empty-string
-
Key of the property
- $value : mixed
-
New value for the property