本文整理汇总了PHP中PucFactory::addVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PucFactory::addVersion方法的具体用法?PHP PucFactory::addVersion怎么用?PHP PucFactory::addVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PucFactory
的用法示例。
在下文中一共展示了PucFactory::addVersion方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addVersion
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
require_once dirname(__FILE__) . '/github-checker.php';
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_2_2', '2.2');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_2_2', '2.2');
PucFactory::addVersion('PluginInfo', 'PluginInfo_2_2', '2.2');
PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_2_2', '2.2');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker', false)) {
class PluginUpdateChecker extends PluginUpdateChecker_2_2
{
}
}
if (!class_exists('PluginUpdate', false)) {
class PluginUpdate extends PluginUpdate_2_2
{
}
}
if (!class_exists('PluginInfo', false)) {
示例2: addVersion
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
require_once dirname(__FILE__) . '/github-checker.php';
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_3_0', '3.0');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_3_0', '3.0');
PucFactory::addVersion('PluginInfo', 'PluginInfo_3_0', '3.0');
PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_3_0', '3.0');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker', false)) {
class PluginUpdateChecker extends PluginUpdateChecker_3_0
{
}
}
if (!class_exists('PluginUpdate', false)) {
class PluginUpdate extends PluginUpdate_3_0
{
}
}
if (!class_exists('PluginInfo', false)) {
示例3: addVersion
*/
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
//RH require_once(dirname(__FILE__) . '/github-checker.php');
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_2_0', '2.0');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_2_0', '2.0');
PucFactory::addVersion('PluginInfo', 'PluginInfo_2_0', '2.0');
//RH PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_2_0', '2.0');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker')) {
class PluginUpdateChecker extends PluginUpdateChecker_2_0
{
}
}
if (!class_exists('PluginUpdate')) {
class PluginUpdate extends PluginUpdate_2_0
{
}
}
示例4: addVersion
* @param string $version Version number, e.g. '1.2'.
*/
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_1_5', '1.5');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_1_3', '1.3');
PucFactory::addVersion('PluginInfo', 'PluginInfo_1_3', '1.3');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker')) {
class PluginUpdateChecker extends PluginUpdateChecker_1_5
{
}
}
if (!class_exists('PluginUpdate')) {
class PluginUpdate extends PluginUpdate_1_3
{
}
}
if (!class_exists('PluginInfo')) {
示例5: addVersion
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
require_once dirname(__FILE__) . '/github-checker.php';
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_2_1', '2.1');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_2_1', '2.1');
PucFactory::addVersion('PluginInfo', 'PluginInfo_2_1', '2.1');
PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_2_1', '2.1');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker', false)) {
class PluginUpdateChecker extends PluginUpdateChecker_2_1
{
}
}
if (!class_exists('PluginUpdate', false)) {
class PluginUpdate extends PluginUpdate_2_1
{
}
}
if (!class_exists('PluginInfo', false)) {
示例6: addVersion
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
require_once dirname(__FILE__) . '/github-checker.php';
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_2_0', '2.0');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_2_0', '2.0');
PucFactory::addVersion('PluginInfo', 'PluginInfo_2_0', '2.0');
PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_2_0', '2.0');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker')) {
class PluginUpdateChecker extends PluginUpdateChecker_2_0
{
}
}
if (!class_exists('PluginUpdate')) {
class PluginUpdate extends PluginUpdate_2_0
{
}
}
if (!class_exists('PluginInfo')) {
示例7: addVersion
* @param string $version Version number, e.g. '1.2'.
*/
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_1_6', '1.6');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_1_6', '1.6');
PucFactory::addVersion('PluginInfo', 'PluginInfo_1_6', '1.6');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker')) {
class PluginUpdateChecker extends PluginUpdateChecker_1_6
{
}
}
if (!class_exists('PluginUpdate')) {
class PluginUpdate extends PluginUpdate_1_6
{
}
}
if (!class_exists('PluginInfo')) {
示例8: addVersion
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
require_once dirname(__FILE__) . '/github-checker.php';
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_2_3', '2.3');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_2_3', '2.3');
PucFactory::addVersion('PluginInfo', 'PluginInfo_2_3', '2.3');
PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_2_3', '2.3');
/**
* Create non-versioned variants of the update checker classes. This allows for backwards
* compatibility with versions that did not use a factory, and it simplifies doc-comments.
*/
if (!class_exists('PluginUpdateChecker', false)) {
class PluginUpdateChecker extends PluginUpdateChecker_2_3
{
}
}
if (!class_exists('PluginUpdate', false)) {
class PluginUpdate extends PluginUpdate_2_3
{
}
}
if (!class_exists('PluginInfo', false)) {
示例9: compareVersions
}
protected static function compareVersions($a, $b)
{
return -version_compare($a, $b);
}
/**
* Register a version of a class.
*
* @access private This method is only for internal use by the library.
*
* @param string $generalClass Class name without version numbers, e.g. 'PluginUpdateChecker'.
* @param string $versionedClass Actual class name, e.g. 'PluginUpdateChecker_1_2'.
* @param string $version Version number, e.g. '1.2'.
*/
public static function addVersion($generalClass, $versionedClass, $version)
{
if (!isset(self::$classVersions[$generalClass])) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
}
require_once dirname(__FILE__) . '/github-checker.php';
//Register classes defined in this file with the factory.
PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_3_1', '3.1');
PucFactory::addVersion('PluginUpdate', 'PluginUpdate_3_1', '3.1');
PucFactory::addVersion('PluginInfo', 'PluginInfo_3_1', '3.1');
PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_3_1', '3.1');