PHP Class PucFactory, bp-reply-by-email

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 {@link PucFactory::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 {@link PucFactory::getLatestClassVersion()} to get the class name and then create it with new $class(...).
Afficher le fichier Open project: r-a-y/bp-reply-by-email Class Usage Examples

Protected Properties

Свойство Type Description
$classVersions
$sorted

Méthodes publiques

Méthode Description
addVersion ( string $generalClass, string $versionedClass, string $version ) Register a version of a class.
buildUpdateChecker ( $metadataUrl, $pluginFile, string $slug = '', integer $checkPeriod = 12, string $optionName = '' ) : PluginUpdateChecker Create a new instance of PluginUpdateChecker.
getLatestClassVersion ( string $class ) : string | null Get the specific class name for the latest available version of a class.

Méthodes protégées

Méthode Description
compareVersions ( $a, $b )
sortVersions ( ) Sort available class versions in descending order (i.e. newest first).

Method Details

addVersion() public static méthode

Register a version of a class.
public static addVersion ( string $generalClass, string $versionedClass, string $version )
$generalClass string Class name without version numbers, e.g. 'PluginUpdateChecker'.
$versionedClass string Actual class name, e.g. 'PluginUpdateChecker_1_2'.
$version string Version number, e.g. '1.2'.

buildUpdateChecker() public static méthode

Create a new instance of PluginUpdateChecker.
See also: PluginUpdateChecker::__construct()
public static buildUpdateChecker ( $metadataUrl, $pluginFile, string $slug = '', integer $checkPeriod = 12, string $optionName = '' ) : PluginUpdateChecker
$metadataUrl
$pluginFile
$slug string
$checkPeriod integer
$optionName string
Résultat PluginUpdateChecker

compareVersions() protected static méthode

protected static compareVersions ( $a, $b )

getLatestClassVersion() public static méthode

Get the specific class name for the latest available version of a class.
public static getLatestClassVersion ( string $class ) : string | null
$class string
Résultat string | null

sortVersions() protected static méthode

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

Property Details

$classVersions protected_oe static_oe property

protected static $classVersions

$sorted protected_oe static_oe property

protected static $sorted