\KernlFactory

A factory that builds instances of other classes from this library.

When multiple versions of the same class have been loaded (e.g. PluginUpdateChecker 1.2 and 1.3), this factory will always use the latest available version. Register class versions by calling KernlFactory::addVersion().

At the moment it can only build instances of the PluginUpdateChecker class. Other classes are intended mainly for internal use and refer directly to specific implementations. If you want to instantiate one of them anyway, you can use KernlFactory::getLatestClassVersion() to get the class name and then create it with new $class(...).

Summary

Methods
Properties
Constants
buildUpdateChecker()
getLatestClassVersion()
addVersion()
No public properties found
No constants found
sortVersions()
compareVersions()
$classVersions
$sorted
N/A
No private methods found
No private properties found
N/A

Properties

$classVersions

$classVersions : 

Type

$sorted

$sorted : 

Type

Methods

buildUpdateChecker()

buildUpdateChecker(  $metadataUrl,   $pluginFile, string  $slug = '', integer  $checkPeriod = 12, string  $optionName = '', string  $muPluginFile = '') : \PluginUpdateChecker

Create a new instance of PluginUpdateChecker.

Parameters

$metadataUrl
$pluginFile
string $slug
integer $checkPeriod
string $optionName
string $muPluginFile

Returns

\PluginUpdateChecker

getLatestClassVersion()

getLatestClassVersion(string  $class) : string|null

Get the specific class name for the latest available version of a class.

Parameters

string $class

Returns

string|null

addVersion()

addVersion(string  $generalClass, string  $versionedClass, string  $version) 

Register a version of a class.

Parameters

string $generalClass

Class name without version numbers, e.g. 'PluginUpdateChecker'.

string $versionedClass

Actual class name, e.g. 'PluginUpdateChecker_1_2'.

string $version

Version number, e.g. '1.2'.

sortVersions()

sortVersions() 

Sort available class versions in descending order (i.e. newest first).

compareVersions()

compareVersions(  $a,   $b) 

Parameters

$a
$b