PHP 클래스 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(...).
파일 보기 프로젝트 열기: r-a-y/bp-reply-by-email 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$classVersions
$sorted

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
compareVersions ( $a, $b )
sortVersions ( ) Sort available class versions in descending order (i.e. newest first).

메소드 상세

addVersion() 공개 정적인 메소드

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() 공개 정적인 메소드

Create a new instance of PluginUpdateChecker.
또한 보기: PluginUpdateChecker::__construct()
public static buildUpdateChecker ( $metadataUrl, $pluginFile, string $slug = '', integer $checkPeriod = 12, string $optionName = '' ) : PluginUpdateChecker
$metadataUrl
$pluginFile
$slug string
$checkPeriod integer
$optionName string
리턴 PluginUpdateChecker

compareVersions() 보호된 정적인 메소드

protected static compareVersions ( $a, $b )

getLatestClassVersion() 공개 정적인 메소드

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

sortVersions() 보호된 정적인 메소드

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

프로퍼티 상세

$classVersions 보호되어 있는 정적으로 프로퍼티

protected static $classVersions

$sorted 보호되어 있는 정적으로 프로퍼티

protected static $sorted