Index: trunk/extensions/MWReleases/MWReleases.alias.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Aliases for MWReleases |
| 4 | + * Special page aliases for MWReleases extension. |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @ingroup Extensions |
— | — | @@ -8,10 +8,10 @@ |
9 | 9 | |
10 | 10 | $aliases = array(); |
11 | 11 | |
12 | | -/** |
13 | | - * English |
| 12 | +/** English |
| 13 | + * @author Chad Horohoe |
14 | 14 | */ |
15 | 15 | $aliases['en'] = array( |
16 | 16 | 'ReleaseManager' => array( 'ReleaseManager' ), |
17 | | - 'DownloadMediawiki' => array( 'DownloadMediawiki' ), |
| 17 | + 'DownloadMediaWiki' => array( 'DownloadMediaWiki' ), |
18 | 18 | ); |
Index: trunk/extensions/MWReleases/backend/Release.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | const SUPPORTED = 2; |
8 | 8 | } |
9 | 9 | |
10 | | -class MediawikiRelease implements Release { |
| 10 | +class MediaWikiRelease implements Release { |
11 | 11 | |
12 | 12 | private $id, $name, $number, $reldate, $eoldate, $branch, $tag, |
13 | 13 | $announcement, $supported = null; |
Index: trunk/extensions/MWReleases/backend/ReleaseRepo.php |
— | — | @@ -43,12 +43,12 @@ |
44 | 44 | |
45 | 45 | public function releaseExists( $id ) { |
46 | 46 | $this->load(); |
47 | | - return isset( $this->releases[ $id ] ); |
| 47 | + return isset( $this->releases[$id] ); |
48 | 48 | } |
49 | 49 | |
50 | 50 | public function getReleaseForId( $id ) { |
51 | 51 | if( $this->releaseExists( $id ) ) { |
52 | | - return $this->releases[ $id ]; |
| 52 | + return $this->releases[$id]; |
53 | 53 | } |
54 | 54 | return null; |
55 | 55 | } |
— | — | @@ -71,9 +71,9 @@ |
72 | 72 | $this->releases = array(); |
73 | 73 | $res = $dbr->select( 'mwreleases', '*', array(), __METHOD__ ); |
74 | 74 | foreach( $res as $row ) { |
75 | | - if( !isset( $this->releases[ $row->mwr_id ] ) ) { |
76 | | - $mw = MediawikiRelease::newFromRow( $row ); |
77 | | - $this->releases[ $mw->getId() ] = $mw; |
| 75 | + if( !isset( $this->releases[$row->mwr_id] ) ) { |
| 76 | + $mw = MediaWikiRelease::newFromRow( $row ); |
| 77 | + $this->releases[$mw->getId()] = $mw; |
78 | 78 | } |
79 | 79 | } |
80 | 80 | uasort( $this->releases, array( $this, 'sortReleasesDesc' ) ); |
Index: trunk/extensions/MWReleases/api/ApiMWReleases.php |
— | — | @@ -5,8 +5,8 @@ |
6 | 6 | */ |
7 | 7 | |
8 | 8 | class ApiMWReleases extends ApiBase { |
9 | | - public function __construct($main, $action) { |
10 | | - parent :: __construct($main, $action); |
| 9 | + public function __construct( $main, $action ) { |
| 10 | + parent::__construct( $main, $action ); |
11 | 11 | } |
12 | 12 | |
13 | 13 | public function execute() { |
— | — | @@ -55,15 +55,15 @@ |
56 | 56 | } |
57 | 57 | $results[] = $r; |
58 | 58 | } |
59 | | - $this->getResult()->setIndexedTagName($results, 'release'); |
60 | | - $this->getResult()->addValue(null, $this->getModuleName(), $results); |
| 59 | + $this->getResult()->setIndexedTagName( $results, 'release' ); |
| 60 | + $this->getResult()->addValue( null, $this->getModuleName(), $results ); |
61 | 61 | } |
62 | 62 | |
63 | 63 | public function getAllowedParams() { |
64 | 64 | return array( |
65 | 65 | 'prop' => array( |
66 | 66 | ApiBase::PARAM_ISMULTI => true, |
67 | | - ApiBase::PARAM_TYPE => array ( |
| 67 | + ApiBase::PARAM_TYPE => array( |
68 | 68 | 'name', |
69 | 69 | 'number', |
70 | 70 | 'reldate', |
— | — | @@ -87,8 +87,8 @@ |
88 | 88 | } |
89 | 89 | |
90 | 90 | public function getDescription() { |
91 | | - return array ( |
92 | | - 'Get the list of current Mediawiki releases' |
| 91 | + return array( |
| 92 | + 'Get the list of current MediaWiki releases' |
93 | 93 | ); |
94 | 94 | } |
95 | 95 | |
— | — | @@ -98,6 +98,7 @@ |
99 | 99 | 'api.php?action=mwreleases&&allreleases=1&prop=name|reldate|eoldate' |
100 | 100 | ); |
101 | 101 | } |
| 102 | + |
102 | 103 | public function getVersion() { |
103 | 104 | return __CLASS__ . ': ' . MWRELEASES_VERSION; |
104 | 105 | } |
Index: trunk/extensions/MWReleases/MWReleases.i18n.php |
— | — | @@ -1,23 +1,26 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | | - * Internationalization file for MWReleases |
| 4 | + * Internationalization file for MWReleases extension. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
6 | 8 | */ |
| 9 | + |
7 | 10 | $messages = array(); |
8 | 11 | |
9 | | -/** |
10 | | - * English |
| 12 | +/** English |
| 13 | + * @author Chad Horohoe |
11 | 14 | */ |
12 | 15 | $messages['en'] = array( |
13 | 16 | 'mwr-desc' => 'Manages releases of the MediaWiki software', |
14 | | - 'releasemanager' => 'Mediawiki release manager', |
15 | | - 'releasemanager-header' => 'Welcome to the Mediawiki release manager. Use the options below to manage the releases', |
| 17 | + 'releasemanager' => 'MediaWiki release manager', |
| 18 | + 'releasemanager-header' => 'Welcome to the MediaWiki release manager. Use the options below to manage the releases', |
16 | 19 | 'releasemanager-add' => 'Add new release', |
17 | 20 | 'releasemanager-supported-til-eol' => 'Supported until EOL date, currently: $1', // $1 is yes/no |
18 | 21 | 'releasemanager-supported-overriden' => 'Support overridden, currently: $1', // $1 is yes/no |
19 | 22 | 'releasemanager-doesnotexist' => 'The specified release does not exist', |
20 | 23 | 'releasemanager-delete-confirm' => 'Are you sure you want to delete this release?', |
21 | | - 'downloadmediawiki' => 'Download Mediawiki', |
| 24 | + 'downloadmediawiki' => 'Download MediaWiki', |
22 | 25 | 'mwr-field-name' => 'Name', |
23 | 26 | 'mwr-field-number' => 'Number', |
24 | 27 | 'mwr-field-eoldate' => 'End of life date', |
Index: trunk/extensions/MWReleases/MWReleases.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | * MWReleases - lets us maintain a list of releases that we support |
5 | | - * on Mediawiki.org, to be queried by the API. Goal is to have the |
| 5 | + * on MediaWiki.org, to be queried by the API. Goal is to have the |
6 | 6 | * installer and updater check MW.org for latest versions :) |
7 | 7 | * |
8 | 8 | * This program is free software; you can redistribute it and/or modify |
— | — | @@ -23,6 +23,10 @@ |
24 | 24 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
25 | 25 | */ |
26 | 26 | |
| 27 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 28 | + die( 'This is not a valid entry point.' ); |
| 29 | +} |
| 30 | + |
27 | 31 | define( 'MWRELEASES_VERSION', '2.0' ); |
28 | 32 | |
29 | 33 | $wgExtensionCredits['other'][] = array( |
— | — | @@ -40,8 +44,8 @@ |
41 | 45 | $wgAutoloadClasses['ApiMWReleases'] = $dir . 'api/ApiMWReleases.php'; |
42 | 46 | $wgAutoloadClasses['ReleaseRepo'] = $dir . 'backend/ReleaseRepo.php'; |
43 | 47 | $wgAutoloadClasses['Release'] = $dir . 'backend/Release.php'; |
44 | | -$wgAutoloadClasses['MediawikiRelease'] = $dir . 'backend/Release.php'; |
45 | | -$wgAutoloadClasses['SpecialDownloadMediawiki'] = $dir . 'ui/SpecialDownloadMediawiki.php'; |
| 48 | +$wgAutoloadClasses['MediaWikiRelease'] = $dir . 'backend/Release.php'; |
| 49 | +$wgAutoloadClasses['SpecialDownloadMediaWiki'] = $dir . 'ui/SpecialDownloadMediawiki.php'; |
46 | 50 | $wgAutoloadClasses['SpecialReleaseManager'] = $dir . 'ui/SpecialReleaseManager.php'; |
47 | 51 | |
48 | 52 | // i18n |
— | — | @@ -52,7 +56,7 @@ |
53 | 57 | $wgAPIModules['mwreleases'] = 'ApiMWReleases'; |
54 | 58 | |
55 | 59 | // Special pages |
56 | | -$wgSpecialPages['DownloadMediawiki'] = 'SpecialDownloadMediawiki'; |
| 60 | +$wgSpecialPages['DownloadMediaWiki'] = 'SpecialDownloadMediaWiki'; |
57 | 61 | $wgSpecialPages['ReleaseManager'] = 'SpecialReleaseManager'; |
58 | 62 | |
59 | 63 | // Hooks |
— | — | @@ -70,6 +74,6 @@ |
71 | 75 | function wfMWReleaseSchemaUpdates() { |
72 | 76 | global $wgExtNewTables; |
73 | 77 | $wgExtNewTables['mwreleases'] = dirname(__FILE__) . '/MWReleases.sql'; |
74 | | - |
| 78 | + |
75 | 79 | return true; |
76 | 80 | } |
\ No newline at end of file |
Index: trunk/extensions/MWReleases/ui/SpecialDownloadMediawiki.php |
— | — | @@ -1,9 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -class SpecialDownloadMediawiki extends SpecialPage { |
| 4 | +class SpecialDownloadMediaWiki extends SpecialPage { |
5 | 5 | |
6 | 6 | public function __construct() { |
7 | | - parent::__construct( 'DownloadMediawiki' ); |
| 7 | + parent::__construct( 'DownloadMediaWiki' ); |
8 | 8 | } |
9 | 9 | |
10 | 10 | public function execute( $par ) { |
Index: trunk/extensions/MWReleases/ui/SpecialReleaseManager.php |
— | — | @@ -25,7 +25,9 @@ |
26 | 26 | switch( $params[0] ) { |
27 | 27 | case 'edit': |
28 | 28 | if( isset( $params[1] ) ) { |
29 | | - if( $wgRequest->wasPosted() ) $this->postEdit( $params[1], $wgRequest ); |
| 29 | + if( $wgRequest->wasPosted() ) { |
| 30 | + $this->postEdit( $params[1], $wgRequest ); |
| 31 | + } |
30 | 32 | $this->showEdit( $params[1] ); |
31 | 33 | } |
32 | 34 | break; |
— | — | @@ -39,7 +41,9 @@ |
40 | 42 | } |
41 | 43 | } |
42 | 44 | case 'add': |
43 | | - if( $wgRequest->wasPosted() ) $this->postAdd( $wgRequest ); |
| 45 | + if( $wgRequest->wasPosted() ) { |
| 46 | + $this->postAdd( $wgRequest ); |
| 47 | + } |
44 | 48 | $this->showAdd(); |
45 | 49 | break; |
46 | 50 | default: |
— | — | @@ -58,8 +62,10 @@ |
59 | 63 | ) . Html::element( 'hr' ) . Html::closeElement( 'div' ) . |
60 | 64 | Html::openElement( 'table', array( 'class' => 'wikitable plainlinks sortable' ) ) . |
61 | 65 | Html::openElement( 'tr' ); |
62 | | - foreach( MediawikiRelease::getFieldNames() as $field ) { |
63 | | - if( $field == 'id' ) continue; |
| 66 | + foreach( MediaWikiRelease::getFieldNames() as $field ) { |
| 67 | + if( $field == 'id' ) { |
| 68 | + continue; |
| 69 | + } |
64 | 70 | $h .= Html::element( 'th', array(), wfMsg( "mwr-field-$field" ) ); |
65 | 71 | } |
66 | 72 | $h .= Html::element( 'th', array(), 'edit/del' ) . Html::closeElement( 'tr' ); |
— | — | @@ -70,7 +76,7 @@ |
71 | 77 | $this->out->addHTML( $h ); |
72 | 78 | } |
73 | 79 | |
74 | | - private function formatReleaseForTable( MediawikiRelease $rel ) { |
| 80 | + private function formatReleaseForTable( MediaWikiRelease $rel ) { |
75 | 81 | global $wgLang; |
76 | 82 | $branchUrl = $this->skin->makeExternalLink( $rel->getBranchUrl(), $rel->getBranch () ); |
77 | 83 | $tagUrl = $this->skin->makeExternalLink( $rel->getTagUrl(), $rel->getTag() ); |
— | — | @@ -106,7 +112,7 @@ |
107 | 113 | } |
108 | 114 | |
109 | 115 | private function showEdit( $versionId ) { |
110 | | - |
| 116 | + |
111 | 117 | } |
112 | 118 | |
113 | 119 | private function postEdit( $versionId, $wgRequest ) { |
— | — | @@ -117,10 +123,10 @@ |
118 | 124 | $this->out->addWikiMsg( 'releasemanager-doesnotexist' ); |
119 | 125 | return; |
120 | 126 | } else { |
121 | | - $submitUrl = $this->getTitleFor( 'ReleaseManager', "delete/$versionId" )->getFullUrl(); |
| 127 | + $submitUrl = $this->getTitleFor( 'ReleaseManager', "delete/$versionId" )->getFullURL(); |
122 | 128 | $this->out->addWikiMsg( 'releasemanager-delete-confirm' ); |
123 | 129 | $h = Html::openElement( 'form', array( 'action' => $submitUrl, |
124 | | - 'method' => 'POST' ) ) . |
| 130 | + 'method' => 'post' ) ) . |
125 | 131 | Html::input( 'submit', wfMsg( 'submit' ), 'submit' ) . |
126 | 132 | Html::closeElement( 'form' ); |
127 | 133 | $this->out->addHTML( $h ); |