Remove some of the rubbish that has been accumulating in the default LocalSettings...
[lhc/web/wiklou.git] / includes / PackageRepository.php
1 <?php
2
3 /**
4 * File holding the PackageRepository class.
5 *
6 * @file PackageRepository.php
7 * @ingroup Deployment
8 *
9 * @author Jeroen De Dauw
10 */
11
12 if ( !defined( 'MEDIAWIKI' ) ) {
13 die( 'Not an entry point.' );
14 }
15
16 /**
17 * Base repository class. Deriving classes handle interaction with
18 * package repositories of the type they support.
19 *
20 * @since 1.17
21 *
22 * @ingroup Deployment
23 *
24 * @author Jeroen De Dauw
25 */
26 abstract class PackageRepository {
27
28 /**
29 * Base location of the repository.
30 *
31 * @since 1.17
32 *
33 * @var string
34 */
35 protected $location;
36
37 /**
38 * Returns a list of extensions matching the search criteria.
39 *
40 * @since 1.17
41 *
42 * @param $filterType String
43 * @param $filterValue String
44 *
45 * @return array
46 */
47 public abstract function findExtenions( $filterType, $filterValue );
48
49 /**
50 * Checks if newer versions of an extension are available.
51 *
52 * @since 1.17
53 *
54 * @param $extensionName String
55 * @param $currentVersion String
56 *
57 * @return Mixed: false when there is no update, object with info when there is.
58 */
59 public abstract function extensionHasUpdate( $extensionName, $currentVersion );
60
61 /**
62 * Checks if newer versions of MediaWiki is available.
63 *
64 * @since 1.17
65 *
66 * @param $currentVersion String
67 *
68 * @return Mixed: false when there is no update, object with info when there is.
69 */
70 public abstract function coreHasUpdate( $currentVersion );
71
72 /**
73 * Returns the latest MediaWiki release, or false when the request fails.
74 *
75 * @since 1.17
76 *
77 * @return Mixed: string or false
78 */
79 public abstract function getLatestCoreVersion();
80
81 /**
82 * Checks if there are any updates for this MediaWiki installation and extensions.
83 *
84 * @since 1.17
85 *
86 * @param $coreVersion String
87 * @param $extensions Array
88 *
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 );
92
93 /**
94 * Constructor.
95 *
96 * @param $location String
97 *
98 * @since 1.17
99 */
100 public function __construct( $location ) {
101 $this->location = $location;
102 }
103
104 /**
105 * Returns the repository location.
106 *
107 * @since 1.17
108 *
109 * @return string
110 */
111 public function getLocation() {
112 return $this->location;
113 }
114
115 }