From 6328b0f41e283b2cfe5b830b2f6eba8e438fc2e5 Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Sun, 15 Aug 2010 09:49:22 +0000 Subject: [PATCH] Follow up to r71107 - added forgotten global function and corrected @since annotations --- includes/DistributionRepository.php | 12 ++++++------ includes/GlobalFunctions.php | 19 +++++++++++++++++++ includes/PackageRepository.php | 14 +++++++------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/includes/DistributionRepository.php b/includes/DistributionRepository.php index 197e64030b..cd06948223 100644 --- a/includes/DistributionRepository.php +++ b/includes/DistributionRepository.php @@ -17,7 +17,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { * Repository class for interaction with repositories provided by * the Distirbution extension and the MediaWiki API. * - * @since 0.1 + * @since 1.17 * * @ingroup Deployment * @@ -30,7 +30,7 @@ class DistributionRepository extends PackageRepository { * * @param $location String: path to the api of the MediaWiki install providing the repository. * - * @since 0.1 + * @since 1.17 */ public function __construct( $location ) { parent::__construct( $location ); @@ -39,7 +39,7 @@ class DistributionRepository extends PackageRepository { /** * @see PackageRepository::findExtenions * - * @since 0.1 + * @since 1.17 * * @param $filterType String * @param $filterValue String @@ -75,7 +75,7 @@ class DistributionRepository extends PackageRepository { /** * @see PackageRepository::extensionHasUpdate * - * @since 0.1 + * @since 1.17 */ public function extensionHasUpdate( $extensionName, $currentVersion ) { global $wgRepositoryPackageStates; @@ -106,7 +106,7 @@ class DistributionRepository extends PackageRepository { /** * @see PackageRepository::coreHasUpdate * - * @since 0.1 + * @since 1.17 */ public function coreHasUpdate( $currentVersion ) { global $wgRepositoryPackageStates; @@ -136,7 +136,7 @@ class DistributionRepository extends PackageRepository { /** * @see PackageRepository::installationHasUpdates * - * @since 0.1 + * @since 1.17 */ public function installationHasUpdates( $coreVersion, array $extensions ) { global $wgRepositoryPackageStates; diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ee80461cfe..6a2139c1d8 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3454,3 +3454,22 @@ function wfArrayMap( $function, $input ) { } return $ret; } + +/** + * Returns the PackageRepository object for interaction with the package repository. + * + * TODO: Make the repository type also configurable. + * + * @since 1.17 + * + * @return PackageRepository + */ +function wfGetRepository() { + global $wgRepository, $wgRepositoryApiLocation; + + if ( !isset( $wgRepository ) ) { + $wgRepository = new DistributionRepository( $wgRepositoryApiLocation ); + } + + return $wgRepository; +} \ No newline at end of file diff --git a/includes/PackageRepository.php b/includes/PackageRepository.php index da110ae634..fb21ad199f 100644 --- a/includes/PackageRepository.php +++ b/includes/PackageRepository.php @@ -17,7 +17,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { * Base repository class. Deriving classes handle interaction with * package repositories of the type they support. * - * @since 0.1 + * @since 1.17 * * @ingroup Deployment * @@ -28,7 +28,7 @@ abstract class PackageRepository { /** * Base location of the repository. * - * @since 0.1 + * @since 1.17 * * @var string */ @@ -37,7 +37,7 @@ abstract class PackageRepository { /** * Returns a list of extensions matching the search criteria. * - * @since 0.1 + * @since 1.17 * * @param $filterType String * @param $filterValue String @@ -49,7 +49,7 @@ abstract class PackageRepository { /** * Checks if newer versions of an extension are available. * - * @since 0.1 + * @since 1.17 * * @param $extensionName String * @param $currentVersion String @@ -61,7 +61,7 @@ abstract class PackageRepository { /** * Checks if newer versions of MediaWiki is available. * - * @since 0.1 + * @since 1.17 * * @param $currentVersion String * @@ -72,7 +72,7 @@ abstract class PackageRepository { /** * Checks if there are any updates for this MediaWiki installation and extensions. * - * @since 0.1 + * @since 1.17 * * @param $coreVersion String * @param $extensions Array @@ -86,7 +86,7 @@ abstract class PackageRepository { * * @param $location String * - * @since 0.1 + * @since 1.17 */ public function __construct( $location ) { $this->location = $location; -- 2.20.1