Index: trunk/extensions/Deployment/specials/SpecialUpdate.php |
— | — | @@ -44,10 +44,19 @@ |
45 | 45 | |
46 | 46 | // If the user is authorized, display the page, if not, show an error. |
47 | 47 | if ( $this->userCanExecute( $wgUser ) ) { |
48 | | - |
| 48 | + $this->showCoreStatus(); |
| 49 | + $this->showExtensionStatuses(); |
49 | 50 | } else { |
50 | 51 | $this->displayRestrictionError(); |
51 | 52 | } |
52 | 53 | } |
53 | 54 | |
| 55 | + protected function showCoreStatus() { |
| 56 | + $repository = wfGetRepository(); |
| 57 | + } |
| 58 | + |
| 59 | + protected function showExtensionStatuses() { |
| 60 | + $repository = wfGetRepository(); |
| 61 | + } |
| 62 | + |
54 | 63 | } |
\ No newline at end of file |
Index: trunk/extensions/Deployment/Deployment.i18n.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | 'extensions-up-to-date' => 'Your extensions are all up to date.', |
44 | 44 | |
45 | 45 | // Special:Install |
46 | | - 'extensions-description' => 'Extensions extend and expand the functionality of MediaWiki. You can browse and search extensions that are in the [http://www.mediawiki.org/wiki/Special:Repository MediaWiki Extension Repository] to install via this page.', |
| 46 | + 'extensions-description' => 'Extensions extend and expand the functionality of MediaWiki. You can browse and search extensions that are in the [$1 MediaWiki Extension Repository] to install via this page.', |
47 | 47 | 'search-extensions' => 'Search', |
48 | 48 | 'search-extensions-long' => 'Search for extensions by keyword, author, or tag.', |
49 | 49 | 'popular-extension-tags' => 'Popular tags', |
Index: trunk/extensions/Deployment/Deployment.php |
— | — | @@ -65,4 +65,19 @@ |
66 | 66 | 'descriptionmsg' => 'deployment-desc', |
67 | 67 | ); |
68 | 68 | |
69 | | -} |
\ No newline at end of file |
| 69 | +} |
| 70 | + |
| 71 | +/** |
| 72 | + * Returns the PackageRepository object for interaction with the package repository. |
| 73 | + * |
| 74 | + * @return PackageRepository |
| 75 | + */ |
| 76 | +function wfGetRepository() { |
| 77 | + global $wgRepository, $wgRepositoryApiLocation; |
| 78 | + |
| 79 | + if ( !isset( $wgRepository ) ) { |
| 80 | + $wgRepository = new DistributionRepository( $wgRepositoryApiLocation ); |
| 81 | + } |
| 82 | + |
| 83 | + return $wgRepository; |
| 84 | +} |
\ No newline at end of file |
Index: trunk/extensions/Deployment/Deployment_Settings.php |
— | — | @@ -10,4 +10,14 @@ |
11 | 11 | * @author Jeroen De Dauw |
12 | 12 | */ |
13 | 13 | |
14 | | -$wgRepositoryApiLocation = 'http://www.mediawiki.org/w/api.php'; |
\ No newline at end of file |
| 14 | +$wgRepositoryLocation = 'http://www.mediawiki.org/wiki/Special:Repository'; |
| 15 | +$wgRepositoryApiLocation = 'http://www.mediawiki.org/w/api.php'; |
| 16 | + |
| 17 | +$wgRepositoryPackageStates = array( |
| 18 | + //'dev', |
| 19 | + //'alpha', |
| 20 | + 'beta', |
| 21 | + //'rc', |
| 22 | + 'stable', |
| 23 | + //'deprecated', |
| 24 | +); |
\ No newline at end of file |
Index: trunk/extensions/Deployment/includes/PackageRepository.php |
— | — | @@ -13,39 +13,79 @@ |
14 | 14 | * Base repository class. Deriving classes handle interaction with |
15 | 15 | * package repositories of the type they support. |
16 | 16 | * |
| 17 | + * @since 0.1 |
| 18 | + * |
| 19 | + * @ingroup Deployment |
| 20 | + * |
17 | 21 | * @author Jeroen De Dauw |
18 | 22 | */ |
19 | 23 | abstract class PackageRepository { |
20 | 24 | |
21 | 25 | /** |
| 26 | + * Base location of the repository. |
| 27 | + * |
| 28 | + * @since 0.1 |
| 29 | + * |
| 30 | + * @var string |
| 31 | + */ |
| 32 | + protected $location; |
| 33 | + |
| 34 | + /** |
| 35 | + * Returns a list of extensions matching the search criteria. |
| 36 | + * |
| 37 | + * @since 0.1 |
| 38 | + * |
| 39 | + * @return array |
| 40 | + */ |
| 41 | + public abstract function findExtenions(); |
| 42 | + |
| 43 | + /** |
22 | 44 | * Constructor. |
| 45 | + * |
| 46 | + * @param $location String |
| 47 | + * |
| 48 | + * @since 0.1 |
23 | 49 | */ |
24 | | - public function __construct() { |
25 | | - // TODO |
| 50 | + public function __construct( $location ) { |
| 51 | + $this->location = $location; |
26 | 52 | } |
27 | 53 | |
28 | 54 | } |
29 | 55 | |
30 | 56 | /** |
31 | | - * Class for interaction with the Ontoprise repository. |
32 | | - * @see PackageRepository |
| 57 | + * Repository class for interaction with repositories provided by |
| 58 | + * the Distirbution extension and the MediaWiki API. |
33 | 59 | * |
| 60 | + * @since 0.1 |
| 61 | + * |
| 62 | + * @ingroup Deployment |
| 63 | + * |
34 | 64 | * @author Jeroen De Dauw |
35 | | - * |
36 | | - * TODO: move to it's own file |
37 | 65 | */ |
38 | | -class OntopriseRepository extends PackageRepository { |
| 66 | +class DistributionRepository extends PackageRepository { |
39 | 67 | |
40 | 68 | /** |
41 | 69 | * Constructor. |
| 70 | + * |
| 71 | + * @param $location String: path to the api of the MediaWiki install providing the repository. |
| 72 | + * |
| 73 | + * @since 0.1 |
42 | 74 | */ |
43 | | - public function __construct() { |
44 | | - parent::__construct(); |
| 75 | + public function __construct( $location ) { |
| 76 | + parent::__construct( $location ); |
| 77 | + } |
| 78 | + |
| 79 | + /** |
| 80 | + * @see PackageRepository::findExtenions |
| 81 | + * |
| 82 | + * @since 0.1 |
| 83 | + * |
| 84 | + * @return array |
| 85 | + */ |
| 86 | + public function findExtenions() { |
| 87 | + global $wgRepositoryPackageStates; |
45 | 88 | |
46 | 89 | // TODO |
47 | | - } |
| 90 | + } |
48 | 91 | |
49 | | -} |
50 | | - |
51 | | -// TODO: if the ontoprise repository structure is acceptable for general use, rename the class, |
52 | | -// if it's not, design a more general repository structure and create a new PackageRepository class to handle. |
\ No newline at end of file |
| 92 | +} |
\ No newline at end of file |