Follow up to r71107 - added forgotten global function and corrected @since annotations
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Sun, 15 Aug 2010 09:49:22 +0000 (09:49 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Sun, 15 Aug 2010 09:49:22 +0000 (09:49 +0000)
includes/DistributionRepository.php
includes/GlobalFunctions.php
includes/PackageRepository.php

index 197e640..cd06948 100644 (file)
@@ -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;
index ee80461..6a2139c 100644 (file)
@@ -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
index da110ae..fb21ad1 100644 (file)
@@ -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;