* In ResourceLoaderContext, lazy-load $this->direction and $this->language, to avoid...
[mediawiki.git] / includes / PackageRepository.php
bloba92c10649bfc4a46df86e1ba62bfe100c1bf9792
1 <?php
3 /**
4 * File holding the PackageRepository class.
6 * @file PackageRepository.php
7 * @ingroup Deployment
9 * @author Jeroen De Dauw
12 if ( !defined( 'MEDIAWIKI' ) ) {
13 die( 'Not an entry point.' );
16 /**
17 * Base repository class. Deriving classes handle interaction with
18 * package repositories of the type they support.
20 * @since 1.17
22 * @ingroup Deployment
24 * @author Jeroen De Dauw
26 abstract class PackageRepository {
28 /**
29 * Base location of the repository.
31 * @since 1.17
33 * @var string
35 protected $location;
37 /**
38 * Returns a list of extensions matching the search criteria.
40 * @since 1.17
42 * @param $filterType String
43 * @param $filterValue String
45 * @return array
47 public abstract function findExtenions( $filterType, $filterValue );
49 /**
50 * Checks if newer versions of an extension are available.
52 * @since 1.17
54 * @param $extensionName String
55 * @param $currentVersion String
57 * @return Mixed: false when there is no update, object with info when there is.
58 */
59 public abstract function extensionHasUpdate( $extensionName, $currentVersion );
61 /**
62 * Checks if newer versions of MediaWiki is available.
64 * @since 1.17
66 * @param $currentVersion String
68 * @return Mixed: false when there is no update, object with info when there is.
69 */
70 public abstract function coreHasUpdate( $currentVersion );
72 /**
73 * Returns the latest MediaWiki release, or false when the request fails.
75 * @since 1.17
77 * @return Mixed: string or false
78 */
79 public abstract function getLatestCoreVersion();
81 /**
82 * Checks if there are any updates for this MediaWiki installation and extensions.
84 * @since 1.17
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.
90 */
91 public abstract function installationHasUpdates( $coreVersion, array $extensions );
93 /**
94 * Constructor.
96 * @param $location String
98 * @since 1.17
100 public function __construct( $location ) {
101 $this->location = $location;
105 * Returns the repository location.
107 * @since 1.17
109 * @return string
111 public function getLocation() {
112 return $this->location;