4 * File holding the PackageRepository class.
6 * @file PackageRepository.php
9 * @author Jeroen De Dauw
12 if ( !defined( 'MEDIAWIKI' ) ) {
13 die( 'Not an entry point.' );
17 * Base repository class. Deriving classes handle interaction with
18 * package repositories of the type they support.
24 * @author Jeroen De Dauw
26 abstract class PackageRepository
{
29 * Base location of the repository.
38 * Returns a list of extensions matching the search criteria.
42 * @param $filterType String
43 * @param $filterValue String
47 public abstract function findExtenions( $filterType, $filterValue );
50 * Checks if newer versions of an extension are available.
54 * @param $extensionName String
55 * @param $currentVersion String
57 * @return Mixed: false when there is no update, object with info when there is.
59 public abstract function extensionHasUpdate( $extensionName, $currentVersion );
62 * Checks if newer versions of MediaWiki is available.
66 * @param $currentVersion String
68 * @return Mixed: false when there is no update, object with info when there is.
70 public abstract function coreHasUpdate( $currentVersion );
73 * Returns the latest MediaWiki release, or false when the request fails.
77 * @return Mixed: string or false
79 public abstract function getLatestCoreVersion();
82 * Checks if there are any updates for this MediaWiki installation and extensions.
86 * @param $coreVersion String
87 * @param $extensions Array
89 * @return Mixed: false when there is are updates, array with obecjts with info when there are.
91 public abstract function installationHasUpdates( $coreVersion, array $extensions );
96 * @param $location String
100 public function __construct( $location ) {
101 $this->location
= $location;
105 * Returns the repository location.
111 public function getLocation() {
112 return $this->location
;