r27900 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r27899‎ | r27900 | r27901 >
Date:18:23, 27 November 2007
Author:tlaqua
Status:old
Tags:
Comment:
Unbreaking extension. ;-)
Added version check for new wfLoadExtensionMessages function
TODO: Make extension do something useful (it's currently identical to Special:Ancientpages)
Modified paths:
  • /trunk/extensions/StalePages/StalePages.i18n.php (modified) (history)
  • /trunk/extensions/StalePages/StalePages.php (modified) (history)
  • /trunk/extensions/StalePages/StalePages_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/StalePages/StalePages_body.php
@@ -27,7 +27,9 @@
2828 }
2929
3030 function execute( $parameters ) {
31 - wfLoadExtensionMessages( 'Stalepages' );
 31+ if( version_compare( $wgVersion, '1.12alpha', '>=' ) ) {
 32+ wfLoadExtensionMessages( 'Stalepages' );
 33+ }
3234
3335 $this->setHeaders();
3436 list( $limit, $offset ) = wfCheckLimits();
Index: trunk/extensions/StalePages/StalePages.i18n.php
@@ -8,7 +8,7 @@
99 $messages = array();
1010
1111 $messages['en'] = array(
12 - 'stalepages' => 'Stale Pages',
 12+ 'stalepages' => 'Stale pages',
1313 'stalepages-summary' => 'This is a list of pages that have not been edited in the last $1 days.',
1414 );
1515
Index: trunk/extensions/StalePages/StalePages.php
@@ -5,20 +5,37 @@
66
77 # Not a valid entry point, skip unless MEDIAWIKI is defined
88 if (!defined('MEDIAWIKI')) {
9 - echo "Stale Pages extension";
 9+ echo "Stale pages extension";
1010 exit(1);
1111 }
1212
1313 $wgExtensionCredits['specialpage'][] = array(
14 - 'name'=>'Stale Pages',
 14+ 'name'=>'Stale pages',
1515 'url'=>'http://www.mediawiki.org/wiki/Extension:Stale_Pages',
1616 'author'=>'Tim Laqua',
1717 'description'=>'Generates a list of pages that have not been edited recently',
1818 'version'=>'0.7'
1919 );
2020
 21+if( version_compare( $wgVersion, '1.12alpha', '>=' ) ) {
 22+ $wgExtensionMessagesFiles['Stalepages'] = $dir . 'StalePages.i18n.php';
 23+} else {
 24+ $wgExtensionFunctions[] = 'efStalepages';
 25+}
 26+
2127 $dir = dirname(__FILE__) . '/';
22 -$wgExtensionMessagesFiles['Stalepages'] = $dir . 'StalePages.i18n.php';
2328 $wgAutoloadClasses['Stalepages'] = $dir . 'StalePages_body.php';
2429
2530 $wgSpecialPages['Stalepages'] = 'Stalepages';
 31+
 32+
 33+///Message Cache population for versions that did not support $wgExtensionFunctions
 34+function efStalePages() {
 35+ global $wgMessageCache;
 36+
 37+ #Add Messages
 38+ require( dirname( __FILE__ ) . '/StalePages.i18n.php' );
 39+ foreach( $messages as $key => $value ) {
 40+ $wgMessageCache->addMessages( $messages[$key], $key );
 41+ }
 42+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r27906Fix regressions in r27759 -- pages already marked in link cache at link parsi...brion20:45, 27 November 2007

Status & tagging log