\MatthiasWeb\RealMediaLibrary\baseCore

Base class for the applications Core class.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
i18n()
updateDbCheck()
getInternalPackages()
getPluginData()
getActivator()
getAssets()
getService()
versionCompareOlderThan()
No public properties found
No constants found
construct()
__construct()
No protected properties found
N/A
No private methods found
$plugin_data
$activator
$assets
$service
N/A

Properties

$plugin_data

$plugin_data :

The stored plugin data.

Type

$activator

$activator :

The plugins activator class.

Type

$assets

$assets :

The plugins asset class.

Type

$service

$service :

The utils service class.

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string

i18n()

i18n()

The plugin is loaded. Start to register the localization (i18n) files.

Also respect packages in vendor dir.

updateDbCheck()

updateDbCheck()

Updates the database version in the options table.

It also installs the needed database tables.

getInternalPackages()

getInternalPackages(): object

Get a list of internal packages (our own, symlinked from the monorepo).

Returns

object

getPluginData()

getPluginData(string  $key = null): array<mixed,string>|string|null

Gets the plugin data.

Parameters

string $key

The key of the data to return

Returns

array<mixed,string>|string|null

versionCompareOlderThan()

versionCompareOlderThan(string|false  $installed,string  $version,array<mixed,string>  $allowedPrerelease = array(),callable  $prereleaseAdditionalCheck = null)

Checks if a previously installed version is lower than an expected version.

Additionally, we can check for a prerelease version, too. The $allowedPrerelease needs to be an array (e.g. ["2.15.1", "2.16.0"]), and if the installed version is a prerelease (e.g. 2.15.1-9507), the version 2.15.1 gets extracted and checked for existence in the array.

Usage with $prereleaseAdditionalCheck: You can pass an additional callback which is executed before returning true when a prerelease got found. An example scenario for this callable is to check for a specific database table if you drop a column. Why is this needed? Imagine you are sending multiple prerelease to a customer.

Parameters

string|false $installed
string $version
array<mixed,string> $allowedPrerelease
callable $prereleaseAdditionalCheck

($prereleaseVersion, $prereleaseCiIid) => boolean

construct()

construct()

The constructor handles the core startup mechanism.

The constructor is protected because a factory method should only create a Core object.

__construct()

__construct()

The constructor handles the core startup mechanism.

The constructor is protected because a factory method should only create a Core object.