Documentation

Core
in package
Uses UtilsProvider, Core

AbstractYes

Base class for the applications Core class.

Table of Contents

Properties

$activator  : Activator
The plugins activator class.
$assets  : Assets
The plugins asset class.
$plugin_data  : mixed
The stored plugin data.
$service  : Service
The utils service class.

Methods

getActivator()  : Activator
Getter.
getAssets()  : Assets
Getter
getInternalPackages()  : object
Get a list of internal packages (our own, symlinked from the monorepo).
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
getPluginData()  : array<string|int, string>|string|null
Gets the plugin data.
getService()  : Service
Getter
i18n()  : mixed
The plugin is loaded. Start to register the localization (i18n) files.
updateDbCheck()  : mixed
Updates the database version in the options table.
versionCompareOlderThan()  : mixed
Checks if a previously installed version is lower than an expected version.
__construct()  : mixed
The constructor handles the core startup mechanism.
construct()  : mixed
The constructor handles the core startup mechanism.

Properties

$assets

The plugins asset class.

private Assets $assets

$plugin_data

The stored plugin data.

private mixed $plugin_data

Methods

getAssets()

Getter

public getAssets() : Assets
Tags
codeCoverageIgnore
Return values
Assets

getInternalPackages()

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

public getInternalPackages() : object
Return values
object

getPluginConstantPrefix()

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

public getPluginConstantPrefix() : string
Tags
codeCoverageIgnore

It only returns a string with the constant prefix

Return values
string

getService()

Getter

public getService() : Service
Tags
codeCoverageIgnore
Return values
Service

i18n()

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

public i18n() : mixed

Also respect packages in vendor dir.

updateDbCheck()

Updates the database version in the options table.

public updateDbCheck() : mixed

It also installs the needed database tables.

versionCompareOlderThan()

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

public static versionCompareOlderThan(string|false $installed, string $version[, array<string|int, string> $allowedPrerelease = [] ][, callable $prereleaseAdditionalCheck = null ]) : mixed

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
$installed : string|false
$version : string
$allowedPrerelease : array<string|int, string> = []
$prereleaseAdditionalCheck : callable = null

($prereleaseVersion, $prereleaseCiIid) => boolean

__construct()

The constructor handles the core startup mechanism.

protected __construct() : mixed

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

Tags
codeCoverageIgnore

construct()

The constructor handles the core startup mechanism.

protected construct() : mixed

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


        
On this page

Search results