r72214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72213‎ | r72214 | r72215 >
Date:19:26, 2 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Better check for location of configure extension.

Also removed some todo tags, hopefully these classes go away soon.
Modified paths:
  • /trunk/extensions/Translate/groups/MediaWikiExtensions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php
@@ -27,13 +27,20 @@
2828 public function init() {
2929 if ( $this->groups !== null ) return;
3030
31 - global $wgAutoloadClasses, $IP, $wgConfigureExtDir;
32 - if ( !isset( $wgConfigureExtDir ) ) {
33 - $wgConfigureExtDir = "$IP/extensions/";
 31+ global $wgAutoloadClasses, $IP, $wgTranslateExtensionDirectory;
 32+
 33+ $postfix = 'Configure/load_txt_def/TxtDef.php';
 34+ if ( file_exists( "$IP/extensions/$postfix" ) ) {
 35+ $prefix = "$IP/extensions";
 36+ } elseif( file_exists( "$wgTranslateExtensionDirectory/$postfix" ) ) {
 37+ $prefix = $wgTranslateExtensionDirectory;
 38+ } else {
 39+ $prefix = false;
3440 }
35 - $wgAutoloadClasses['TxtDef'] = $wgConfigureExtDir . "Configure/load_txt_def/TxtDef.php";
36 - if ( $this->useConfigure && class_exists( 'TxtDef' ) ) {
37 - $tmp = TxtDef::loadFromFile( $wgConfigureExtDir . "Configure/settings/Settings-ext.txt" );
 41+
 42+ if ( $this->useConfigure && $prefix ) {
 43+ $wgAutoloadClasses['TxtDef'] = "$prefix/$postfix";
 44+ $tmp = TxtDef::loadFromFile( "$prefix/Configure/settings/Settings-ext.txt" );
3845 $configureData = array_combine( array_map( array( __CLASS__, 'foldId' ), array_keys( $tmp ) ), array_values( $tmp ) );
3946 } else {
4047 $configureData = array();
@@ -309,8 +316,6 @@
310317 /**
311318 * Adds a message group containing all supported MediaWiki extensions used by
312319 * Wikimedia.
313 - *
314 - * @todo Needs documentation.
315320 */
316321 class AllWikimediaExtensionsGroup extends AllMediawikiExtensionsGroup {
317322 protected $label = 'Extensions used by Wikimedia';
@@ -446,8 +451,6 @@
447452 /**
448453 * Adds a message group containing all components of the MediaWiki extension
449454 * Collection.
450 - *
451 - * @todo Needs documentation.
452455 */
453456 class AllCollectionExtensionsGroup extends AllMediawikiExtensionsGroup {
454457 protected $label = 'Collection';
@@ -476,8 +479,6 @@
477480 /**
478481 * Adds a message group containing all components of the MediaWiki extension
479482 * FlaggedRevs.
480 - *
481 - * @todo Needs documentation.
482483 */
483484 class AllFlaggedRevsExtensionsGroup extends AllMediawikiExtensionsGroup {
484485 protected $label = 'FlaggedRevs';
@@ -515,8 +516,6 @@
516517 /**
517518 * Adds a message group containing all components of the MediaWiki extension
518519 * ReaderFeedback.
519 - *
520 - * @todo Needs documentation.
521520 */
522521 class AllReaderFeedbackExtensionsGroup extends AllMediawikiExtensionsGroup {
523522 protected $label = 'ReaderFeedback';
@@ -546,8 +545,6 @@
547546 /**
548547 * Adds a message group containing all components of the MediaWiki extension
549548 * SocialProfile.
550 - *
551 - * @todo Needs documentation.
552549 */
553550 class AllSocialProfileExtensionsGroup extends AllMediawikiExtensionsGroup {
554551 protected $label = 'Social Profile';
@@ -582,8 +579,6 @@
583580 /**
584581 * Adds a message group containing all components of the MediaWiki extension
585582 * Translate.
586 - *
587 - * @todo Needs documentation.
588583 */
589584 class AllTranslateExtensionsGroup extends AllMediawikiExtensionsGroup {
590585 protected $label = 'Translate';
@@ -613,8 +608,6 @@
614609 /**
615610 * Adds a message group containing all components of the MediaWiki extension
616611 * Uniwiki.
617 - *
618 - * @todo Needs documentation.
619612 */
620613 class AllUniwikiExtensionsGroup extends AllMediawikiExtensionsGroup {
621614 protected $label = 'Uniwiki';
@@ -653,8 +646,6 @@
654647 /**
655648 * Adds a message group containing all components of the Wikimedia Usability
656649 * Initiative.
657 - *
658 - * @todo Needs documentation.
659650 */
660651 class AllUsabilityInitiativeExtensionsGroup extends AllMediawikiExtensionsGroup {
661652 protected $label = 'Usability Initiative';

Status & tagging log