r43987 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43986‎ | r43987 | r43988 >
Date:23:17, 26 November 2008
Author:siebrand
Status:reverted (Comments)
Tags:
Comment:
Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions.
Modified paths:
  • /trunk/extensions/AjaxQueryPages/Load.php (modified) (history)
  • /trunk/extensions/AntiBot/AntiBot.php (modified) (history)
  • /trunk/extensions/AntiSpoof/generateEquivset.php (modified) (history)
  • /trunk/extensions/Babel/Babel.php (modified) (history)
  • /trunk/extensions/BackAndForth/BackAndForth.php (modified) (history)
  • /trunk/extensions/BookInformation/BookInformation.php (modified) (history)
  • /trunk/extensions/CategoryTree/CategoryTree.php (modified) (history)
  • /trunk/extensions/CheckUser/CheckUser.php (modified) (history)
  • /trunk/extensions/CheckUser/install.php (modified) (history)
  • /trunk/extensions/Cite/Cite.php (modified) (history)
  • /trunk/extensions/Configure/Configure.settings.php (modified) (history)
  • /trunk/extensions/Configure/manage.php (modified) (history)
  • /trunk/extensions/Configure/migrateToDB.php (modified) (history)
  • /trunk/extensions/Configure/writePHP.php (modified) (history)
  • /trunk/extensions/ConfigureWMF/ConfigureWMF.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php (modified) (history)
  • /trunk/extensions/ConfirmEdit/FancyCaptcha.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /trunk/extensions/DumpHTML/dumpHTML.php (modified) (history)
  • /trunk/extensions/EmailPage/EmailPage.php (modified) (history)
  • /trunk/extensions/ExtensionDistributor/ExtensionDistributor.php (modified) (history)
  • /trunk/extensions/FileSearch/FileSearch.php (modified) (history)
  • /trunk/extensions/FormatDates/FormatDates.php (modified) (history)
  • /trunk/extensions/GroupPermissionsManager/GetMessages.php (modified) (history)
  • /trunk/extensions/GroupPermissionsManager/GroupPermissionsManager_body.php (modified) (history)
  • /trunk/extensions/GroupPermissionsManager/SortPermissions.php (modified) (history)
  • /trunk/extensions/LabeledSectionTransclusion/lst.php (modified) (history)
  • /trunk/extensions/Makebot/Makebot.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/News/News.php (modified) (history)
  • /trunk/extensions/OpenID/OpenID.setup.php (modified) (history)
  • /trunk/extensions/OpenSearchXml/OpenSearchXml.php (modified) (history)
  • /trunk/extensions/ParserFunctions/ParserFunctions.php (modified) (history)
  • /trunk/extensions/Player/Player.php (modified) (history)
  • /trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber.php (modified) (history)
  • /trunk/extensions/Poem/Poem.php (modified) (history)
  • /trunk/extensions/RandomImage/RandomImage.php (modified) (history)
  • /trunk/extensions/Renameuser/SpecialRenameuser.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_conceptCache.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php (modified) (history)
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.php (modified) (history)
  • /trunk/extensions/TrustedXFF/TrustedXFF.php (modified) (history)
  • /trunk/extensions/cldr/LanguageNames.body.php (modified) (history)
  • /trunk/extensions/geoserver/geoserver.php (modified) (history)
  • /trunk/phase3/img_auth.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKu.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageZh.deps.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageZh.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfigureWMF/ConfigureWMF.php
@@ -30,9 +30,10 @@
3131
3232 $wgConfigureStdlogo = '$stdlogo';
3333
34 -$wgExtensionMessagesFiles['ConfigureWMF'] = dirname( __FILE__ ) . '/ConfigureWMF.i18n.php';
35 -$wgAutoloadClasses['ConfigureWMF'] = dirname( __FILE__ ) . '/ConfigureWMF.class.php';
36 -$wgAutoloadClasses['SpecialConfigure'] = dirname( __FILE__ ) . '/ConfigureWMF.page.php';
 34+$dir = dirname(__FILE__) . '/';
 35+$wgExtensionMessagesFiles['ConfigureWMF'] = $dir . 'ConfigureWMF.i18n.php';
 36+$wgAutoloadClasses['ConfigureWMF'] = $dir . 'ConfigureWMF.class.php';
 37+$wgAutoloadClasses['SpecialConfigure'] = $dir . 'ConfigureWMF.page.php';
3738
3839 $wgSpecialPages['Configure'] = 'SpecialConfigure';
3940
Index: trunk/extensions/RandomImage/RandomImage.php
@@ -10,8 +10,6 @@
1111 */
1212
1313 if( defined( 'MEDIAWIKI' ) ) {
14 -
15 - $wgAutoloadClasses['RandomImage'] = dirname( __FILE__ ) . '/RandomImage.class.php';
1614 $wgExtensionCredits['parserhook'][] = array(
1715 'name' => 'RandomImage',
1816 'author' => 'Rob Church',
@@ -21,7 +19,10 @@
2220 'description' => 'Provides a random media picker using <tt>&lt;randomimage /&gt;</tt>',
2321 'descriptionmsg' => 'randomimage-desc',
2422 );
25 - $wgExtensionMessagesFiles['RandomImage'] = dirname(__FILE__) . '/RandomImage.i18n.php';
 23+
 24+ $dir = dirname(__FILE__) . '/';
 25+ $wgAutoloadClasses['RandomImage'] = $dir . 'RandomImage.class.php';
 26+ $wgExtensionMessagesFiles['RandomImage'] = $dir . 'RandomImage.i18n.php';
2627 $wgHooks['ParserAfterStrip'][] = 'RandomImage::stripHook';
2728 $wgExtensionFunctions[] = 'efRandomImageSetup';
2829
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_conceptCache.php
@@ -14,9 +14,11 @@
1515
1616 $optionsWithArgs = array( 'concept', 'old', 's', 'e');
1717
 18+$dir = dirname(__FILE__) . '/';
 19+
1820 require_once ( getenv('MW_INSTALL_PATH') !== false
1921 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
20 - : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' );
 22+ : $dir . '../../../maintenance/commandLine.inc' );
2123 require_once("$IP/maintenance/counter.php");
2224
2325 $output_level = array_key_exists('quiet', $options)?0:
@@ -94,7 +96,7 @@
9597
9698 global $smwgIP;
9799 if (! isset($smwgIP))
98 - $smwgIP = dirname(__FILE__) . '/..';
 100+ $smwgIP = $dir . '..';
99101
100102 require_once($smwgIP . '/includes/SMW_GlobalFunctions.php');
101103
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php
@@ -42,9 +42,11 @@
4343 */
4444 $optionsWithArgs = array( 'b', 'user', 'password');
4545
 46+$dir = dirname(__FILE__) . '/';
 47+
4648 require_once ( getenv('MW_INSTALL_PATH') !== false
4749 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
48 - : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' );
 50+ : $dir . '../../../maintenance/commandLine.inc' );
4951 require_once("$IP/maintenance/counter.php");
5052
5153 global $smwgDefaultStore;
@@ -75,7 +77,7 @@
7678
7779 global $smwgIP;
7880 if (! isset($smwgIP))
79 - $smwgIP = dirname(__FILE__) . '/..';
 81+ $smwgIP = $dir . '..';
8082
8183 require_once($smwgIP . '/includes/SMW_GlobalFunctions.php');
8284
Index: trunk/extensions/DumpHTML/dumpHTML.php
@@ -55,12 +55,13 @@
5656 }
5757
5858 $IP = getenv( 'MW_INSTALL_PATH' );
 59+$dir = dirname(__FILE__) . '/';
5960 if ( $IP === false ) {
60 - $IP = dirname(__FILE__).'/../..';
 61+ $IP = $dir . '../..';
6162 }
6263 require_once( $IP."/maintenance/commandLine.inc" );
63 -require_once( dirname(__FILE__)."/dumpHTML.inc" );
64 -require_once( dirname(__FILE__)."/SkinOffline.php" );
 64+require_once( $dir . "dumpHTML.inc" );
 65+require_once( $dir . "SkinOffline.php" );
6566
6667 if ( version_compare( $wgVersion, '1.11.1', '<' ) ) {
6768 echo "Error, the DumpHTML extension needs at least MediaWiki version 1.11.1 to work, you have version $wgVersion.\n";
Index: trunk/extensions/Babel/Babel.php
@@ -39,18 +39,20 @@
4040 $wgHooks[ 'LanguageGetMagic' ][] = 'BabelStatic::Magic';
4141 $wgHooks[ 'AbortNewAccount' ][] = 'BabelAutoCreate::RegisterAbort';
4242
 43+$dir = dirname(__FILE__) . '/';
 44+
4345 // Register internationalisation file.
44 -$wgExtensionMessagesFiles[ 'Babel' ] = dirname( __FILE__ ) . '/Babel.i18n.php';
 46+$wgExtensionMessagesFiles[ 'Babel' ] = $dir . 'Babel.i18n.php';
4547
4648 // Register autoload classes.
47 -$wgAutoloadClasses[ 'Babel' ] = dirname( __FILE__ ) . '/Babel.class.php';
48 -$wgAutoloadClasses[ 'BabelStatic' ] = dirname( __FILE__ ) . '/BabelStatic.class.php';
49 -$wgAutoloadClasses[ 'BabelAutoCreate' ] = dirname( __FILE__ ) . '/BabelAutoCreate.class.php';
 49+$wgAutoloadClasses[ 'Babel' ] = $dir . 'Babel.class.php';
 50+$wgAutoloadClasses[ 'BabelStatic' ] = $dir . 'BabelStatic.class.php';
 51+$wgAutoloadClasses[ 'BabelAutoCreate' ] = $dir . 'BabelAutoCreate.class.php';
5052
5153 // Configuration setttings.
5254 $wgBabelUseLevelZeroCategory = false;
5355 $wgBabelUseSimpleCategories = false;
5456 $wgBabelUseMainCategories = true;
5557 $wgLanguageCodesFiles = array();
56 -$wgLanguageCodesFiles[ 'ISO_639_1' ] = dirname( __FILE__ ) . '/codes/ISO_639_1.php';
57 -$wgLanguageCodesFiles[ 'ISO_639_3' ] = dirname( __FILE__ ) . '/codes/ISO_639_3.php';
\ No newline at end of file
 58+$wgLanguageCodesFiles[ 'ISO_639_1' ] = $dir . 'codes/ISO_639_1.php';
 59+$wgLanguageCodesFiles[ 'ISO_639_3' ] = $dir . 'codes/ISO_639_3.php';
\ No newline at end of file
Index: trunk/extensions/FormatDates/FormatDates.php
@@ -11,8 +11,9 @@
1212
1313 if( defined( 'MEDIAWIKI' ) ) {
1414
15 - $wgAutoloadClasses['DateParser'] = dirname( __FILE__ ) . '/DateParser.php';
16 - $wgAutoloadClasses['FormattableDate'] = dirname( __FILE__ ) . '/FormattableDate.php';
 15+ $dir = dirname(__FILE__) . '/';
 16+ $wgAutoloadClasses['DateParser'] = $dir . 'DateParser.php';
 17+ $wgAutoloadClasses['FormattableDate'] = $dir . 'FormattableDate.php';
1718 $wgExtensionFunctions[] = 'efFormatDates';
1819
1920 $wgExtensionCredits['parserhook'][] = array(
Index: trunk/extensions/Poem/Poem.php
@@ -32,9 +32,11 @@
3333 'description' => 'Adds <tt>&lt;poem&gt;</tt> tag for poem formatting',
3434 'descriptionmsg' => 'poem-desc',
3535 );
36 -$wgParserTestFiles[] = dirname( __FILE__ ) . "/poemParserTests.txt";
37 -$wgExtensionMessagesFiles['Poem'] = dirname(__FILE__) . '/Poem.i18n.php';
3836
 37+$dir = dirname(__FILE__) . '/';
 38+$wgParserTestFiles[] = $dir . "poemParserTests.txt";
 39+$wgExtensionMessagesFiles['Poem'] = $dir . 'Poem.i18n.php';
 40+
3941 function wfPoemExtension() {
4042 $GLOBALS['wgParser']->setHook("poem","PoemExtension");
4143 return true;
Index: trunk/extensions/BookInformation/BookInformation.php
@@ -23,15 +23,16 @@
2424 'url' => 'http://www.mediawiki.org/wiki/Extension:BookInformation',
2525 );
2626
27 -$wgExtensionMessagesFiles['BookInformation'] = dirname(__FILE__) . '/BookInformation.i18n.php';
 27+$dir = dirname(__FILE__) . '/';
 28+$wgExtensionMessagesFiles['BookInformation'] = $dir . 'BookInformation.i18n.php';
2829
29 -$wgAutoloadClasses['BookInformation'] = dirname( __FILE__ ) . '/drivers/Worker.php';
30 -$wgAutoloadClasses['BookInformationCache'] = dirname( __FILE__ ) . '/drivers/Cache.php';
31 -$wgAutoloadClasses['BookInformationDriver'] = dirname( __FILE__ ) . '/drivers/Driver.php';
32 -$wgAutoloadClasses['BookInformationResult'] = dirname( __FILE__ ) . '/drivers/Result.php';
 30+$wgAutoloadClasses['BookInformation'] = $dir . 'drivers/Worker.php';
 31+$wgAutoloadClasses['BookInformationCache'] = $dir . 'drivers/Cache.php';
 32+$wgAutoloadClasses['BookInformationDriver'] = $dir . 'drivers/Driver.php';
 33+$wgAutoloadClasses['BookInformationResult'] = $dir . 'drivers/Result.php';
3334
34 -$wgAutoloadClasses['BookInformationAmazon'] = dirname( __FILE__ ) . '/drivers/Amazon.php';
35 -$wgAutoloadClasses['BookInformationIsbnDb'] = dirname( __FILE__ ) . '/drivers/IsbnDb.php';
 35+$wgAutoloadClasses['BookInformationAmazon'] = $dir . 'drivers/Amazon.php';
 36+$wgAutoloadClasses['BookInformationIsbnDb'] = $dir . 'drivers/IsbnDb.php';
3637
3738 $wgExtensionFunctions[] = 'efBookInformationSetup';
3839 $wgHooks['BookInformation'][] = 'efBookInformation';
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -21,13 +21,14 @@
2222 require_once( $mvgIP . '/languages/MV_Language.php' );
2323
2424 // Register special page aliases file
 25+$dir = dirname(__FILE__) . '/';
2526 $wgExtensionAliasesFiles['MetavidWiki'] = $mvgIP . '/languages/MV_Aliases.php';
2627
2728 $markerList = array();
2829
2930 // override special search page:
3031 $wgSpecialPages['Search'] = 'MV_SpecialSearch';
31 -$wgAutoloadClasses['MV_SpecialSearch'] = dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php';
 32+$wgAutoloadClasses['MV_SpecialSearch'] = $dir . 'specials/MV_SpecialMediaSearch.php';
3233
3334 function enableMetavid() {
3435 global $wgExtensionFunctions, $smwgNamespacesWithSemanticLinks;
@@ -99,54 +100,55 @@
100101 /**********************************************/
101102 /***** register autoLoad Classes: *****/
102103 /**********************************************/
103 - // setup autoload classes:
104 - $wgAutoloadClasses['MV_Overlay'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_Overlay.php';
105 - $wgAutoloadClasses['MV_Component'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_Component.php';
 104+ // setup autoload classes:
 105+ $dir = dirname(__FILE__) . '/';
 106+ $wgAutoloadClasses['MV_Overlay'] = $dir . 'MV_MetavidInterface/MV_Overlay.php';
 107+ $wgAutoloadClasses['MV_Component'] = $dir . 'MV_MetavidInterface/MV_Component.php';
106108
107 - $wgAutoloadClasses['MV_MetavidInterface'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_MetavidInterface.php';
108 - $wgAutoloadClasses['MV_SequencePlayer'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_SequencePlayer.php';
109 - $wgAutoloadClasses['MV_SequenceTools'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_SequenceTools.php';
110 - $wgAutoloadClasses['MV_SequenceTimeline'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_SequenceTimeline.php';
111 - $wgAutoloadClasses['MV_VideoPlayer'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_VideoPlayer.php';
112 - $wgAutoloadClasses['MV_Tools'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_Tools.php';
113 - $wgAutoloadClasses['MV_Navigator'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_Navigator.php';
114 - $wgAutoloadClasses['MV_EditPageAjax'] = dirname( __FILE__ ) . '/MV_MetavidInterface/MV_EditPageAjax.php';
 109+ $wgAutoloadClasses['MV_MetavidInterface'] = $dir . 'MV_MetavidInterface/MV_MetavidInterface.php';
 110+ $wgAutoloadClasses['MV_SequencePlayer'] = $dir . 'MV_MetavidInterface/MV_SequencePlayer.php';
 111+ $wgAutoloadClasses['MV_SequenceTools'] = $dir . 'MV_MetavidInterface/MV_SequenceTools.php';
 112+ $wgAutoloadClasses['MV_SequenceTimeline'] = $dir . 'MV_MetavidInterface/MV_SequenceTimeline.php';
 113+ $wgAutoloadClasses['MV_VideoPlayer'] = $dir . 'MV_MetavidInterface/MV_VideoPlayer.php';
 114+ $wgAutoloadClasses['MV_Tools'] = $dir . 'MV_MetavidInterface/MV_Tools.php';
 115+ $wgAutoloadClasses['MV_Navigator'] = $dir . 'MV_MetavidInterface/MV_Navigator.php';
 116+ $wgAutoloadClasses['MV_EditPageAjax'] = $dir . 'MV_MetavidInterface/MV_EditPageAjax.php';
115117
116 - $wgAutoloadClasses['MV_CategoryPage'] = dirname( __FILE__ ) . '/articlepages/MV_CategoryPage.php';
117 - $wgAutoloadClasses['MV_SequencePage'] = dirname( __FILE__ ) . '/articlepages/MV_SequencePage.php';
118 - $wgAutoloadClasses['MV_StreamPage'] = dirname( __FILE__ ) . '/articlepages/MV_StreamPage.php';
119 - $wgAutoloadClasses['MV_EditDataPage'] = $wgAutoloadClasses['MV_DataPage'] = dirname( __FILE__ ) . '/articlepages/MV_DataPage.php';
120 - $wgAutoloadClasses['MV_EditStreamPage'] = dirname( __FILE__ ) . '/MV_EditStreamPage.php';
 118+ $wgAutoloadClasses['MV_CategoryPage'] = $dir . 'articlepages/MV_CategoryPage.php';
 119+ $wgAutoloadClasses['MV_SequencePage'] = $dir . 'articlepages/MV_SequencePage.php';
 120+ $wgAutoloadClasses['MV_StreamPage'] = $dir . 'articlepages/MV_StreamPage.php';
 121+ $wgAutoloadClasses['MV_EditDataPage'] = $wgAutoloadClasses['MV_DataPage'] = $dir . 'articlepages/MV_DataPage.php';
 122+ $wgAutoloadClasses['MV_EditStreamPage'] = $dir . 'MV_EditStreamPage.php';
121123
122124
123 - $wgAutoloadClasses['MV_Title'] = dirname( __FILE__ ) . '/MV_Title.php';
124 - $wgAutoloadClasses['MV_Index'] = dirname( __FILE__ ) . '/MV_Index.php';
125 - $wgAutoloadClasses['MV_ImageGallery'] = dirname( __FILE__ ) . '/MV_ImageGallery.php';
126 - $wgAutoloadClasses['MV_Image'] = dirname( __FILE__ ) . '/MV_Image.php';
127 - $wgAutoloadClasses['MV_Stream'] = dirname( __FILE__ ) . '/MV_Stream.php';
128 - $wgAutoloadClasses['MV_StreamFile'] = dirname( __FILE__ ) . '/MV_StreamFile.php';
 125+ $wgAutoloadClasses['MV_Title'] = $dir . 'MV_Title.php';
 126+ $wgAutoloadClasses['MV_Index'] = $dir . 'MV_Index.php';
 127+ $wgAutoloadClasses['MV_ImageGallery'] = $dir . 'MV_ImageGallery.php';
 128+ $wgAutoloadClasses['MV_Image'] = $dir . 'MV_Image.php';
 129+ $wgAutoloadClasses['MV_Stream'] = $dir . 'MV_Stream.php';
 130+ $wgAutoloadClasses['MV_StreamFile'] = $dir . 'MV_StreamFile.php';
129131
130 - $wgAutoloadClasses['MV_StreamImage'] = dirname( __FILE__ ) . '/MV_StreamImage.php';
131 - $wgAutoloadClasses['MV_ParserCache'] = dirname( __FILE__ ) . '/MV_ParserCache.php';
132 - $wgAutoloadClasses['MV_MagicWords'] = dirname( __FILE__ ) . '/MV_MagicWords.php';
 132+ $wgAutoloadClasses['MV_StreamImage'] = $dir . 'MV_StreamImage.php';
 133+ $wgAutoloadClasses['MV_ParserCache'] = $dir . 'MV_ParserCache.php';
 134+ $wgAutoloadClasses['MV_MagicWords'] = $dir . 'MV_MagicWords.php';
133135
134136 /**********************************************/
135137 /***** register special pages hooks *****/
136138 /**********************************************/
137 - $wgAutoloadClasses['MV_SpecialCRUDStream'] = dirname( __FILE__ ) . '/specials/MV_SpecialCRUDStream.php';
 139+ $wgAutoloadClasses['MV_SpecialCRUDStream'] = $dir . 'specials/MV_SpecialCRUDStream.php';
138140 $wgSpecialPages['Mv_Add_Stream'] = array( 'MV_SpecialCRUDStream' );
139141
140 - $wgAutoloadClasses['MV_SpecialListStreams'] = dirname( __FILE__ ) . '/specials/MV_SpecialListStreams.php';
 142+ $wgAutoloadClasses['MV_SpecialListStreams'] = $dir . 'specials/MV_SpecialListStreams.php';
141143 $wgSpecialPages['Mv_List_Streams'] = array( 'MV_SpecialListStreams' );
142144
143145 /* special export views */
144 - $wgAutoloadClasses['MV_SpecialExport'] = dirname( __FILE__ ) . '/specials/MV_SpecialExport.php';
 146+ $wgAutoloadClasses['MV_SpecialExport'] = $dir . 'specials/MV_SpecialExport.php';
145147
146 - $wgAutoloadClasses['MvVideoFeed'] = dirname( __FILE__ ) . '/specials/MV_SpecialExport.php';
147 - $wgAutoloadClasses['MvExportStream'] = dirname( __FILE__ ) . '/specials/MV_SpecialExport.php';
148 - $wgAutoloadClasses['MvExportSequence'] = dirname( __FILE__ ) . '/specials/MV_SpecialExport.php';
149 - $wgAutoloadClasses['MvExportSearch'] = dirname( __FILE__ ) . '/specials/MV_SpecialExport.php';
150 - $wgAutoloadClasses['MvExportAsk'] = dirname( __FILE__ ) . '/specials/MV_SpecialExport.php';
 148+ $wgAutoloadClasses['MvVideoFeed'] = $dir . 'specials/MV_SpecialExport.php';
 149+ $wgAutoloadClasses['MvExportStream'] = $dir . 'specials/MV_SpecialExport.php';
 150+ $wgAutoloadClasses['MvExportSequence'] = $dir . 'specials/MV_SpecialExport.php';
 151+ $wgAutoloadClasses['MvExportSearch'] = $dir . 'specials/MV_SpecialExport.php';
 152+ $wgAutoloadClasses['MvExportAsk'] = $dir . 'specials/MV_SpecialExport.php';
151153
152154 $wgSpecialPages['MvVideoFeed'] = array( 'MvVideoFeed' );
153155 $wgSpecialPages['MvExportStream'] = array( 'MvExportStream' );
@@ -154,20 +156,20 @@
155157 $wgSpecialPages['MvExportSearch'] = array( 'MvExportSearch' );
156158 $wgSpecialPages['MvExportAsk'] = array( 'MvExportAsk' );
157159
158 - $wgAutoloadClasses['MV_SpecialMediaSearch'] = dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php';
 160+ $wgAutoloadClasses['MV_SpecialMediaSearch'] = $dir . 'specials/MV_SpecialMediaSearch.php';
159161 $wgSpecialPages['Mv_List_Streams'] = array( 'MV_SpecialListStreams' );
160162
161 - $wgAutoloadClasses['MediaSearch'] = dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php';
 163+ $wgAutoloadClasses['MediaSearch'] = $dir . 'specials/MV_SpecialMediaSearch.php';
162164 $wgSpecialPages['MediaSearch'] = array( 'MediaSearch' );
163165 $wgSpecialPages['MV_SpecialSearch'] = array( 'MV_SpecialSearch' );
164166
165 - $wgAutoloadClasses['MVAdmin'] = dirname( __FILE__ ) . '/specials/MV_SpecialMVAdmin.php';
 167+ $wgAutoloadClasses['MVAdmin'] = $dir . 'specials/MV_SpecialMVAdmin.php';
166168 $wgSpecialPages['MVAdmin'] = array( 'MVAdmin' );
167 - // require_once( dirname(__FILE__) . '/specials/MV_SpecialCRUDStream.php');
168 - // require_once( dirname(__FILE__) . '/specials/MV_SpecialListStreams.php');
169 - // require_once( dirname(__FILE__) . '/specials/MV_SpecialExport.php');
170 - // require_once( dirname(__FILE__) . '/specials/MV_SpecialMediaSearch.php');
171 - // require_once( dirname(__FILE__) . '/specials/MV_SpecialMVAdmin.php');
 169+ // require_once( $dir . 'specials/MV_SpecialCRUDStream.php');
 170+ // require_once( $dir . 'specials/MV_SpecialListStreams.php');
 171+ // require_once( $dir . 'specials/MV_SpecialExport.php');
 172+ // require_once( $dir . 'specials/MV_SpecialMediaSearch.php');
 173+ // require_once( $dir . 'specials/MV_SpecialMVAdmin.php');
172174
173175 /**********************************************/
174176 /***** register hooks *****/
@@ -220,7 +222,7 @@
221223 * MV_OggHandler.php handles all the re-mapping
222224 */
223225 if($wgMediaHandlers['application/ogg'] == 'OggHandler'){
224 - $wgAutoloadClasses['mvOggHandler'] = dirname( __FILE__ ) . '/MV_OggHandler.php';
 226+ $wgAutoloadClasses['mvOggHandler'] = $dir . 'MV_OggHandler.php';
225227 $wgMediaHandlers['application/ogg']='mvOggHandler';
226228 $wgParserOutputHooks['OggHandler'] = array( 'mvOggHandler', 'outputHook' );
227229 foreach($wgHooks['LanguageGetMagic'] as & $hook_function){
Index: trunk/extensions/AntiSpoof/generateEquivset.php
@@ -1,21 +1,21 @@
22 <?php
33
 4+$dir = dirname(__FILE__) . '/';
 5+
46 require_once ( getenv('MW_INSTALL_PATH') !== false
57 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
6 - : dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' );
 8+ : $dir . '../../maintenance/commandLine.inc' );
79
8 -$dir = dirname( __FILE__ );
9 -
1010 $endl = '
1111 ';
1212
13 -$lines = file( "$dir/equivset.in" );
 13+$lines = file( $dir . "equivset.in" );
1414 if ( !$lines ) {
1515 print "Unable to open equivset.in\n";
1616 exit( 1 );
1717 }
1818
19 -$setsFile = fopen( "$dir/equivset.txt", 'w' );
 19+$setsFile = fopen( $dir . "equivset.txt", 'w' );
2020 if ( !$setsFile ) {
2121 print "Unable to open equivset.txt for writing\n";
2222 exit( 1 );
@@ -31,7 +31,7 @@
3232 EOT
3333 );
3434
35 -$outputFile = fopen( "$dir/equivset.php", 'w' );
 35+$outputFile = fopen( $dir . "equivset.php", 'w' );
3636 if ( !$outputFile ) {
3737 print "Unable to open equivset.php for writing\n";
3838 exit( 1 );
@@ -46,7 +46,7 @@
4747 EOT
4848 );
4949
50 -$serializedFile = fopen( "$dir/equivset.ser", 'w' );
 50+$serializedFile = fopen( $dir . "equivset.ser", 'w' );
5151 if ( !$serializedFile ) {
5252 print "Unable to open equivset.ser for writing\n";
5353 exit( 1 );
Index: trunk/extensions/Configure/migrateToDB.php
@@ -9,13 +9,14 @@
1010 * @license GPLv2 or higher
1111 */
1212
 13+$dir = dirname(__FILE__) . '/';
1314 $IP = getenv( 'MW_INSTALL_PATH' );
1415 if ( $IP === false )
15 - $IP = dirname( __FILE__ ) . '/../..';
 16+ $IP = $dir . '../..';
1617
1718 require_once( "$IP/maintenance/commandLine.inc" );
1819
19 -require_once( dirname( __FILE__ ) . "/migrateToDB.inc" );
 20+require_once( $dir . "migrateToDB.inc" );
2021
2122 $obj = new FilesToDB( $options );
2223 $obj->run();
Index: trunk/extensions/Configure/writePHP.php
@@ -11,13 +11,14 @@
1212
1313 $optionsWithArgs = array( 'wiki', 'version', 'file' );
1414
 15+$dir = dirname(__FILE__) . '/';
1516 $IP = getenv( 'MW_INSTALL_PATH' );
1617 if ( $IP === false )
17 - $IP = dirname( __FILE__ ) . '/../..';
 18+ $IP = $dir . '../..';
1819
1920 require_once( "$IP/maintenance/commandLine.inc" );
2021
21 -require_once( dirname( __FILE__ ) . '/writePHP.inc' );
 22+require_once( $dir . 'writePHP.inc' );
2223
2324 $obj = new ConfigurationWriter( $options );
2425 $obj->run();
Index: trunk/extensions/Configure/Configure.settings.php
@@ -38,7 +38,8 @@
3939 return;
4040 $this->initialized = true;
4141
42 - require( dirname( __FILE__ ) . '/Configure.settings-core.php' );
 42+ $dir = dirname(__FILE__) . '/';
 43+ require( $dir . 'Configure.settings-core.php' );
4344 $this->settings = $settings;
4445 $this->arrayDefs = $arrayDefs;
4546 $this->emptyValues = $emptyValues;
@@ -47,7 +48,7 @@
4849 $this->notEditableSettings = $notEditableSettings;
4950 $this->settingsVersion = $settingsVersion;
5051
51 - require( dirname( __FILE__ ) . '/Configure.settings-ext.php' );
 52+ require( $dir . 'Configure.settings-ext.php' );
5253 $this->extensions = $extensions;
5354 }
5455
Index: trunk/extensions/Configure/manage.php
@@ -12,13 +12,14 @@
1313 $optionsWithArgs = array( 'revert', 'delete' );
1414 define( 'EXT_CONFIGURE_NO_EXTRACT', true );
1515
 16+$dir = dirname(__FILE__) . '/';
1617 $IP = getenv( 'MW_INSTALL_PATH' );
1718 if ( $IP === false )
18 - $IP = dirname( __FILE__ ) . '/../..';
 19+ $IP = $dir . '../..';
1920
2021 require_once( "$IP/maintenance/commandLine.inc" );
2122
22 -require_once( dirname( __FILE__ ) . '/manage.inc' );
 23+require_once( $dir . 'manage.inc' );
2324
2425 $obj = new ConfigurationManager( $options );
2526 $obj->run();
Index: trunk/extensions/LabeledSectionTransclusion/lst.php
@@ -32,9 +32,11 @@
3333 'description' => 'Adds #lst and #lstx functions and &lt;section&gt; tag, enables marked sections of text to be transcluded',
3434 'descriptionmsg' => 'lst-desc',
3535 );
36 -$wgParserTestFiles[] = dirname( __FILE__ ) . "/lstParserTests.txt";
37 -$wgExtensionMessagesFiles['LabeledSectionTransclusion'] = dirname(__FILE__) . '/lst.i18n.php';
3836
 37+$dir = dirname(__FILE__) . '/';
 38+$wgParserTestFiles[] = $dir . "lstParserTests.txt";
 39+$wgExtensionMessagesFiles['LabeledSectionTransclusion'] = $dir . 'lst.i18n.php';
 40+
3941 // Local settings variable
4042 // Must be set now to avoid injection via register_globals
4143 $wgLstLocal = null;
Index: trunk/extensions/cldr/LanguageNames.body.php
@@ -60,8 +60,10 @@
6161 private static function loadLanguage( $code ) {
6262 if ( !isset(self::$cache[$code]) ) {
6363
 64+ $dir = dirname(__FILE__) . '/';
 65+
6466 /** Load override for wrong or missing entries in cldr */
65 - $override = dirname(__FILE__) . '/' . self::getOverrideFileName( $code );
 67+ $override = $dir . self::getOverrideFileName( $code );
6668 if ( file_exists( $override ) ) {
6769 $names = false;
6870 require( $override );
@@ -70,7 +72,7 @@
7173 }
7274 }
7375
74 - $filename = dirname(__FILE__) . '/' . self::getFileName( $code );
 76+ $filename = $dir . self::getFileName( $code );
7577 if ( file_exists( $filename ) ) {
7678 $names = false;
7779 require( $filename );
Index: trunk/extensions/GroupPermissionsManager/GroupPermissionsManager_body.php
@@ -283,7 +283,8 @@
284284 */
285285 private function writeFile( $type ) {
286286 //can we write the file?
287 - if(!is_writable( dirname(__FILE__) . "/config" )) {
 287+ $dir = dirname(__FILE__) . '/';
 288+ if(!is_writable( $dir . "config" )) {
288289 echo( "<h2>Cannot write config file, aborting</h2>
289290
290291 <p>In order to use this extension, you need to make the /config subdirectory of this extension
@@ -293,8 +294,8 @@
294295 die( 1 );
295296 }
296297 $this->oldrev = gmdate('dmYHis');
297 - if(file_exists(dirname(__FILE__) . '/config/GroupPermissions.php')) {
298 - $r = rename(dirname(__FILE__) . '/config/GroupPermissions.php', dirname(__FILE__) . '/config/GroupPermissions.' . $this->oldrev . '.php');
 298+ if(file_exists( $dir . 'config/GroupPermissions.php')) {
 299+ $r = rename( $dir . 'config/GroupPermissions.php', $dir . 'config/GroupPermissions.' . $this->oldrev . '.php');
299300 if(!$r) {
300301 global $wgOut;
301302 $wgOut->addWikiText(wfMsg('grouppermissions-nooldrev'));
@@ -397,7 +398,7 @@
398399 }
399400
400401 $grouppermissions = str_replace( "\r\n", "\n", $grouppermissions );
401 - chdir( dirname(__FILE__) . "/config" );
 402+ chdir( $dir . "config" );
402403 $f = fopen( "GroupPermissions.php", 'wt' );
403404 if(fwrite( $f, $grouppermissions ) ) {
404405 fclose( $f );
Index: trunk/extensions/GroupPermissionsManager/SortPermissions.php
@@ -42,7 +42,7 @@
4343 if($success) {
4444 $wgOut->addWikiText(wfMsg('grouppermissions-sp-success'));
4545 global $wgGroupPermissions, $wgGPManagerSortTypes, $wgGPManagerSort;
46 - require(dirname(__FILE__).'/config/SortPermissions.php');
 46+ require( $dir . '/config/SortPermissions.php');
4747 }
4848 }
4949 $this->makeForm();
@@ -132,7 +132,9 @@
133133 */
134134 private function writeFile() {
135135 //can we write the file?
136 - if(!is_writable( dirname(__FILE__) . "/config" )) {
 136+ $dir = dirname(__FILE__) . '/';
 137+
 138+ if(!is_writable( $dir . "config" )) {
137139 echo( "<h2>Cannot write config file, aborting</h2>
138140
139141 <p>In order to use this extension, you need to make the /config subdirectory of this extension
@@ -142,8 +144,8 @@
143145 die( 1 );
144146 }
145147 $this->oldrev = gmdate('dmYHis');
146 - if(file_exists(dirname(__FILE__) . '/config/SortPermissions.php')) {
147 - $r = rename(dirname(__FILE__) . '/config/SortPermissions.php', dirname(__FILE__) . '/config/SortPermissions.' . $this->oldrev . '.php');
 148+ if(file_exists( $dir . 'config/SortPermissions.php')) {
 149+ $r = rename( $dir . 'config/SortPermissions.php', $dir . 'config/SortPermissions.' . $this->oldrev . '.php');
148150 if(!$r) {
149151 global $wgOut;
150152 $wgOut->addWikiText(wfMsg('grouppermissions-nooldrev'));
@@ -207,7 +209,7 @@
208210 $sortpermissions .= "\n\$wgGPManagerSort['$key'] = array($st);";
209211 }
210212 $sortpermissions = str_replace( "\r\n", "\n", $sortpermissions );
211 - chdir( dirname(__FILE__) . '/config' );
 213+ chdir( $dir . 'config' );
212214 $f = fopen( 'SortPermissions.php', 'wt' );
213215 if(!fwrite( $f, $sortpermissions ) ) {
214216 echo('<p class="error">An error occured while writing the config/SortPermissions.php file. Check user rights and disk space then try again.</p>');
@@ -217,9 +219,9 @@
218220 fclose($f);
219221 if($nr !== array()) {
220222 $np = '';
221 - if(file_exists(dirname(__FILE__) . '/config/GroupPermissions.php')) {
222 - $np = file_get_contents(dirname(__FILE__) . '/config/GroupPermissions.php');
223 - $r = rename(dirname(__FILE__) . '/config/GroupPermissions.php', dirname(__FILE__) . '/config/GroupPermissions.' . $this->oldrev . '.php');
 223+ if(file_exists( $dir . 'config/GroupPermissions.php')) {
 224+ $np = file_get_contents( $dir . 'config/GroupPermissions.php');
 225+ $r = rename( $dir . 'config/GroupPermissions.php', $dir . 'config/GroupPermissions.' . $this->oldrev . '.php');
224226 if(!$r) {
225227 global $wgOut;
226228 $wgOut->addWikiText(wfMsg('grouppermissions-nooldrev'));
Index: trunk/extensions/GroupPermissionsManager/GetMessages.php
@@ -10,12 +10,13 @@
1111 }
1212
1313 global $wgExtensionMessagesFiles;
14 -require(dirname(__FILE__) . '/GroupPermissionsManager.i18n.php');
 14+$dir = dirname(__FILE__) . '/';
 15+require( $dir . 'GroupPermissionsManager.i18n.php');
1516
16 -$files = scandir(dirname(__FILE__) . '/plugins/messages');
 17+$files = scandir( $dir . 'plugins/messages');
1718 foreach($files as $file) {
1819 if(preg_match('/\.i18n\.php5?$/i', $file)) {
19 - $wgExtensionMessagesFiles[$file] = dirname(__FILE__) . '/plugins/messages/' . $file;
 20+ $wgExtensionMessagesFiles[$file] = $dir . 'plugins/messages/' . $file;
2021 wfLoadExtensionMessages($file);
2122 }
2223 }
Index: trunk/extensions/BackAndForth/BackAndForth.php
@@ -12,7 +12,6 @@
1313 die( 1 );
1414 }
1515
16 -$wgAutoloadClasses['BackAndForth'] = dirname( __FILE__ ) . '/BackAndForth.class.php';
1716 $wgExtensionFunctions[] = 'efBackAndForth';
1817 $wgExtensionCredits['other'][] = array(
1918 'name' => 'Back and Forth',
@@ -24,7 +23,9 @@
2524 'url' => 'http://www.mediawiki.org/wiki/Extension:Back-and-Forth',
2625 );
2726
28 -$wgExtensionMessagesFiles['BackAndForth'] = dirname(__FILE__) . '/BackAndForth.i18n.php';
 27+$dir = dirname(__FILE__) . '/';
 28+$wgAutoloadClasses['BackAndForth'] = $dir . 'BackAndForth.class.php';
 29+$wgExtensionMessagesFiles['BackAndForth'] = $dir . 'BackAndForth.i18n.php';
2930
3031 /**
3132 * Extension setup function
Index: trunk/extensions/AntiBot/AntiBot.php
@@ -40,8 +40,10 @@
4141 'description' => 'Simple framework for spambot checks and trigger payloads',
4242 'descriptionmsg' => 'antibot-desc',
4343 );
44 -$wgExtensionMessagesFiles['AntiBot'] = dirname(__FILE__) . '/AntiBot.i18n.php';
4544
 45+$dir = dirname(__FILE__) . '/';
 46+$wgExtensionMessagesFiles['AntiBot'] = $dir . 'AntiBot.i18n.php';
 47+
4648 /**
4749 * A map of payload types to callbacks
4850 * This may be extended by plugins.
@@ -53,7 +55,7 @@
5456 );
5557
5658 # Load plugins
57 -foreach ( glob( dirname( __FILE__ ) . '/active/*.php' ) as $file ) {
 59+foreach ( glob( $dir . 'active/*.php' ) as $file ) {
5860 require( $file );
5961 }
6062
Index: trunk/extensions/FileSearch/FileSearch.php
@@ -12,9 +12,10 @@
1313 if( defined( 'MEDIAWIKI' ) ) {
1414
1515 $wgExtensionFunctions[] = 'efFileSearchSetup';
16 - $wgAutoloadClasses['FileSearchIndexer'] = dirname( __FILE__ ) . '/FileSearchIndexer.php';
17 - $wgAutoloadClasses['Extractor'] = dirname( __FILE__ ) . '/extract/Extractor.php';
18 - $wgFileSearchExtractors['TextExtractor'] = dirname( __FILE__ ) . '/extract/TextExtractor.php';
 16+ $dir = dirname(__FILE__) . '/';
 17+ $wgAutoloadClasses['FileSearchIndexer'] = $dir . 'FileSearchIndexer.php';
 18+ $wgAutoloadClasses['Extractor'] = $dir . 'extract/Extractor.php';
 19+ $wgFileSearchExtractors['TextExtractor'] = $dir . 'extract/TextExtractor.php';
1920
2021 function efFileSearchSetup() {
2122 global $wgHooks;
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.php
@@ -18,9 +18,10 @@
1919 'descriptionmsg' => 'titleblacklist-desc',
2020 );
2121
22 -$wgExtensionMessagesFiles['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.i18n.php';
23 -$wgAutoloadClasses['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.list.php';
24 -$wgAutoloadClasses['TitleBlacklistHooks'] = dirname( __FILE__ ) . '/TitleBlacklist.hooks.php';
 22+$dir = dirname(__FILE__) . '/';
 23+$wgExtensionMessagesFiles['TitleBlacklist'] = $dir . 'TitleBlacklist.i18n.php';
 24+$wgAutoloadClasses['TitleBlacklist'] = $dir . 'TitleBlacklist.list.php';
 25+$wgAutoloadClasses['TitleBlacklistHooks'] = $dir . 'TitleBlacklist.hooks.php';
2526
2627 /** @defgroup Title blacklist source types
2728 * @{
Index: trunk/extensions/OpenSearchXml/OpenSearchXml.php
@@ -30,11 +30,11 @@
3131 'url' => 'http://www.mediawiki.org/wiki/Extension:OpenSearchXml'
3232 );
3333
34 -$wgExtensionMessagesFiles['OpenSearchXml'] = dirname(__FILE__) . '/OpenSearchXml.i18n.php';
 34+$dir = dirname(__FILE__) . '/';
 35+$wgExtensionMessagesFiles['OpenSearchXml'] = $dir . 'OpenSearchXml.i18n.php';
3536
3637 $wgAPIModules['opensearch'] = 'ApiOpenSearchXml';
37 -$wgAutoloadClasses['ApiOpenSearchXml'] =
38 - dirname(__FILE__) . '/ApiOpenSearchXml.php';
 38+$wgAutoloadClasses['ApiOpenSearchXml'] = $dir . 'ApiOpenSearchXml.php';
3939
4040 $wgHooks['OpenSearchUrls'][] = 'efOpenSearchXmlUrls';
4141
Index: trunk/extensions/Player/Player.php
@@ -44,7 +44,7 @@
4545 $wgPlayerTemplates = array();
4646 $wgPlayerVideoResolutionDetector = NULL;
4747
48 -require_once( dirname( __FILE__ ) . '/PlayerDefaultSettings.php' );
 48+require_once( $dir . 'PlayerDefaultSettings.php' );
4949
5050 function playerSetup() {
5151 global $wgParser;
Index: trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber.php
@@ -86,8 +86,9 @@
8787 /*
8888 * end config
8989 */
90 -$wgExtensionMessagesFiles['PlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber.i18n.php';
91 -$wgAutoloadClasses['SpecialPlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber_body.php';
 90+$dir = dirname(__FILE__) . '/';
 91+$wgExtensionMessagesFiles['PlayerStatsGrabber'] = $dir . 'PlayerStatsGrabber.i18n.php';
 92+$wgAutoloadClasses['SpecialPlayerStatsGrabber'] = $dir . 'PlayerStatsGrabber_body.php';
9293 $wgSpecialPages['PlayerStatsGrabber'] = array( 'SpecialPlayerStatsGrabber' );
9394
9495 $wgSpecialPageGroups['PlayerStatsGrabber'] = 'wiki'; // like Special:Statistics
Index: trunk/extensions/EmailPage/EmailPage.php
@@ -22,13 +22,14 @@
2323 $wgEmailPageAllowAllUsers = false; # Whether to allow sending to all users (the "user" group)
2424 $wgEmailPageToolboxLink = true; # Add a link to the sidebar toolbox?
2525 $wgEmailPageActionLink = true; # Add a link to the actions links?
26 -$wgPhpMailerClass = dirname(__FILE__).'/phpMailer_v2.1.0beta2/class.phpmailer.php'; # From http://phpmailer.sourceforge.net/
2726
 27+$dir = dirname(__FILE__) . '/';
 28+$wgPhpMailerClass = $dir . 'phpMailer_v2.1.0beta2/class.phpmailer.php'; # From http://phpmailer.sourceforge.net/
 29+
2830 if ($wgEmailPageGroup) $wgGroupPermissions['sysop'][$wgEmailPageGroup] = true;
2931
3032 if (isset($_SERVER['SERVER_ADDR'])) $wgEmailPageAllowRemoteAddr[] = $_SERVER['SERVER_ADDR'];
3133
32 -$dir = dirname(__FILE__) . '/';
3334 $wgAutoloadClasses['SpecialEmailPage'] = $dir . 'EmailPage_body.php';
3435 $wgExtensionMessagesFiles['EmailPage'] = $dir . 'EmailPage.i18n.php';
3536 $wgExtensionAliasesFiles['EmailPage'] = $dir . 'EmailPage.alias.php';
Index: trunk/extensions/AjaxQueryPages/Load.php
@@ -19,11 +19,12 @@
2020 'descriptionmsg' => 'ajax-qp-desc',
2121 );
2222
23 - $wgExtensionMessagesFiles['AjaxQueryPages'] = dirname(__FILE__) . '/AjaxQueryPages.i18n.php';
 23+ $dir = dirname(__FILE__) . '/';
 24+ $wgExtensionMessagesFiles['AjaxQueryPages'] = $dir . 'AjaxQueryPages.i18n.php';
2425
2526 // Load hooks
26 - require_once(dirname(__FILE__) . '/Hooks.php');
 27+ require_once( $dir . 'Hooks.php');
2728
2829 // Set up AJAX entry point:
29 - require_once(dirname(__FILE__) . '/Response.php');
 30+ require_once( $dir . 'Response.php');
3031 }
Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -39,9 +39,6 @@
4040 $wgSpecialPages['ContributionStatistics'] = 'SpecialContributionStatistics';
4141 $wgSpecialPages['FundraiserStatistics'] = 'SpecialFundraiserStatistics';
4242
43 -// Shortcut to this extension directory
44 -$dir = dirname( __FILE__ ) . '/';
45 -
4643 // CutOff for fiscal year
4744 $egContributionStatisticsFiscalYearCutOff = 'July 1';
4845
@@ -86,4 +83,3 @@
8784
8885 return $db;
8986 }
90 -
Index: trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php
@@ -177,7 +177,6 @@
178178 return true;
179179 }
180180
181 -$dir = dirname(__FILE__) . '/';
182181 # Request an account
183182 $wgSpecialPages['RequestAccount'] = 'RequestAccountPage';
184183 $wgAutoloadClasses['RequestAccountPage'] = $dir . 'RequestAccount_body.php';
Index: trunk/extensions/News/News.php
@@ -33,8 +33,8 @@
3434
3535 $wgExtensionFunctions[] = "wfNewsExtension";
3636
37 -$wgAutoloadClasses['NewsRenderer'] = dirname( __FILE__ ) . '/NewsRenderer.php';
38 -$wgAutoloadClasses['NewsFeedPage'] = dirname( __FILE__ ) . '/NewsRenderer.php';
 37+$wgAutoloadClasses['NewsRenderer'] = $dir . 'NewsRenderer.php';
 38+$wgAutoloadClasses['NewsFeedPage'] = $dir . 'NewsRenderer.php';
3939 $wgHooks['ArticleFromTitle'][] = 'wfNewsArticleFromTitle';
4040 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'wfNewsSkinTemplateOutputPageBeforeExec';
4141
Index: trunk/extensions/OpenID/OpenID.setup.php
@@ -107,7 +107,8 @@
108108
109109 $wgExtensionFunctions[] = 'setupOpenID';
110110
111 -$wgExtensionMessagesFiles['OpenID'] = dirname(__FILE__) . '/OpenID.i18n.php';
 111+$dir = dirname(__FILE__) . '/';
 112+$wgExtensionMessagesFiles['OpenID'] = $dir . 'OpenID.i18n.php';
112113
113114 $wgExtensionCredits['other'][] = array(
114115 'name' => 'OpenID',
@@ -132,17 +133,17 @@
133134
134135 # Gets stored in the session, needs to be reified before our setup
135136 $wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = OpenIDGetServerPath();
136 -$wgExtensionMessagesFiles['OpenID'] = dirname(__FILE__) . '/OpenID.i18n.php';
 137+$wgExtensionMessagesFiles['OpenID'] = $dir . 'OpenID.i18n.php';
137138 # Autoload for special pages
138139
139140 foreach (array('Login', 'Finish', 'Convert', 'Server', 'XRDS') as $sub) {
140 - $wgAutoloadClasses['SpecialOpenID' . $sub] = dirname(__FILE__) . '/SpecialOpenID' . $sub . '.body.php';
 141+ $wgAutoloadClasses['SpecialOpenID' . $sub] = $dir . 'SpecialOpenID' . $sub . '.body.php';
141142 $wgSpecialPages['OpenID'.$sub] = array('SpecialOpenID'.$sub);
142143 }
143144
144145 # Autoload common parent with utility methods
145146
146 -$wgAutoloadClasses['SpecialOpenID'] = dirname(__FILE__) . '/SpecialOpenID.body.php';
 147+$wgAutoloadClasses['SpecialOpenID'] = $dir . 'SpecialOpenID.body.php';
147148
148149 $wgHooks['PersonalUrls'][] = 'OpenIDPersonalUrls';
149150 $wgHooks['UserToggles'][] = 'OpenIDUserToggles';
Index: trunk/extensions/ExtensionDistributor/ExtensionDistributor.php
@@ -45,9 +45,10 @@
4646 /********************
4747 * Registration
4848 */
 49+$dir = dirname(__FILE__) . '/';
4950 $wgSpecialPages['ExtensionDistributor'] = 'ExtensionDistributorPage';
50 -$wgAutoloadClasses['ExtensionDistributorPage'] = dirname(__FILE__).'/ExtensionDistributor_body.php';
51 -$wgExtensionMessagesFiles['ExtensionDistributor'] = dirname(__FILE__).'/ExtensionDistributor.i18n.php';
 51+$wgAutoloadClasses['ExtensionDistributorPage'] = $dir . 'ExtensionDistributor_body.php';
 52+$wgExtensionMessagesFiles['ExtensionDistributor'] = $dir . 'ExtensionDistributor.i18n.php';
5253
5354 $wgExtensionCredits['specialpage'][] = array(
5455 'name' => 'Extension Distributor',
Index: trunk/extensions/TrustedXFF/TrustedXFF.php
@@ -10,8 +10,9 @@
1111 *
1212 * For details, see http://meta.wikimedia.org/wiki/XFF_project
1313 */
14 -$wgTrustedXffFile = dirname(__FILE__).'/trusted-xff.cdb';
1514
 15+$dir = dirname(__FILE__) . '/';
 16+$wgTrustedXffFile = $dir . 'trusted-xff.cdb';
1617
1718 /** Registration */
1819 $wgExtensionCredits['other'][] = array(
@@ -22,7 +23,7 @@
2324 'descriptionmsg' => 'trustedxff-desc',
2425 'author' => 'Tim Starling'
2526 );
26 -$wgExtensionMessagesFiles['TrustedXFF'] = dirname(__FILE__) . '/TrustedXFF.i18n.php';
 27+$wgExtensionMessagesFiles['TrustedXFF'] = $dir . 'TrustedXFF.i18n.php';
2728 $wgHooks['IsTrustedProxy'][] = 'TrustedXFF::onIsTrustedProxy';
2829
2930 class TrustedXFF {
Index: trunk/extensions/geoserver/geoserver.php
@@ -29,7 +29,7 @@
3030 $dir = dirname(__FILE__) . '/';
3131 $wgAutoloadClasses['WFS'] = $dir . 'WFS.php';
3232
33 -require_once( dirname(__FILE__) . '/SpecialWikimaps.php' );
 33+require_once( $dir . 'SpecialWikimaps.php' );
3434 /**
3535 * Called whenever a <geo> needs to be parsed
3636 *
Index: trunk/extensions/ConfirmEdit/FancyCaptcha.php
@@ -37,6 +37,6 @@
3838 global $wgCaptchaSecret;
3939 $wgCaptchaSecret = "CHANGE_THIS_SECRET!";
4040
41 -$wgExtensionMessagesFiles['FancyCaptcha'] = dirname(__FILE__).'/FancyCaptcha.i18n.php';
42 -$wgAutoloadClasses['FancyCaptcha'] = dirname( __FILE__ ) . '/FancyCaptcha.class.php';
43 -
 41+$dir = dirname(__FILE__) . '/';
 42+$wgExtensionMessagesFiles['FancyCaptcha'] = $dir . 'FancyCaptcha.i18n.php';
 43+$wgAutoloadClasses['FancyCaptcha'] = $dir . 'FancyCaptcha.class.php';
Index: trunk/extensions/Renameuser/SpecialRenameuser.php
@@ -57,8 +57,8 @@
5858 return $rv;
5959 }
6060
61 -$wgAutoloadClasses['SpecialRenameuser'] = dirname( __FILE__ ) . '/SpecialRenameuser_body.php';
62 -$wgAutoloadClasses['RenameUserJob'] = dirname(__FILE__) . '/RenameUserJob.php';
 61+$wgAutoloadClasses['SpecialRenameuser'] = $dir . 'SpecialRenameuser_body.php';
 62+$wgAutoloadClasses['RenameUserJob'] = $dir . 'RenameUserJob.php';
6363 $wgSpecialPages['Renameuser'] = 'SpecialRenameuser';
6464 $wgSpecialPageGroups['Renameuser'] = 'users';
6565 $wgJobClasses['renameUser'] = 'RenameUserJob';
Index: trunk/extensions/CheckUser/CheckUser.php
@@ -351,9 +351,8 @@
352352
353353 $wgSpecialPages['CheckUser'] = 'CheckUser';
354354 $wgSpecialPageGroups['CheckUser'] = 'users';
355 -$wgAutoloadClasses['CheckUser'] = dirname(__FILE__) . '/CheckUser_body.php';
 355+$wgAutoloadClasses['CheckUser'] = $dir . 'CheckUser_body.php';
356356
357 -
358357 function efLoadCheckUserLink( $id, $nt, &$links ) {
359358 global $wgUser;
360359 if( $wgUser->isAllowed( 'checkuser' ) ) {
Index: trunk/extensions/CheckUser/install.php
@@ -4,10 +4,11 @@
55 * Makes the required database changes for the CheckUser extension
66 */
77
 8+$dir = dirname(__FILE__) . '/';
89 require_once ( getenv('MW_INSTALL_PATH') !== false
910 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
10 - : dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' );
11 -require_once dirname( __FILE__ ) . '/install.inc';
 11+ : $dir . '../../maintenance/commandLine.inc' );
 12+require_once $dir . 'install.inc';
1213
1314 $db =& wfGetDB( DB_MASTER );
1415 if ( $db->tableExists( 'cu_changes' ) && !isset( $options['force'] ) ) {
Index: trunk/extensions/Makebot/Makebot.php
@@ -46,7 +46,7 @@
4747 /**
4848 * Register the special page
4949 */
50 - $wgAutoloadClasses['Makebot'] = dirname( __FILE__ ) . '/Makebot.class.php';
 50+ $wgAutoloadClasses['Makebot'] = $dir . 'Makebot.class.php';
5151 $wgSpecialPages['Makebot'] = 'Makebot';
5252 $wgSpecialPageGroups['Makebot'] = 'users';
5353
Index: trunk/extensions/Cite/Cite.php
@@ -33,9 +33,11 @@
3434 'descriptionmsg' => 'cite_desc',
3535 'url' => 'http://www.mediawiki.org/wiki/Extension:Cite/Cite.php'
3636 );
37 -$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt";
38 -$wgExtensionMessagesFiles['Cite'] = dirname( __FILE__ ) . "/Cite.i18n.php";
39 -$wgAutoloadClasses['Cite'] = dirname( __FILE__ ) . "/Cite_body.php";
 37+
 38+$dir = dirname(__FILE__) . '/';
 39+$wgParserTestFiles[] = $dir . "citeParserTests.txt";
 40+$wgExtensionMessagesFiles['Cite'] = $dir . "Cite.i18n.php";
 41+$wgAutoloadClasses['Cite'] = $dir . "Cite_body.php";
4042 $wgSpecialPageGroups['Cite'] = 'pagetools';
4143
4244 define( 'CITE_DEFAULT_GROUP', '');
Index: trunk/extensions/CategoryTree/CategoryTree.php
@@ -102,8 +102,6 @@
103103 $wgCategoryTreePageCategoryOptions['depth'] = 0;
104104 #$wgCategoryTreePageCategoryOptions['class'] = 'CategoryTreeInlineNode';
105105
106 -$wgExtensionAliasesFiles['CategoryTree'] = dirname(__FILE__) . '/CategoryTreePage.i18n.alias.php';
107 -
108106 /**
109107 * Register extension setup hook and credits
110108 */
@@ -131,6 +129,7 @@
132130 * Register the special page
133131 */
134132 $dir = dirname(__FILE__) . '/';
 133+$wgExtensionAliasesFiles['CategoryTree'] = $dir . 'CategoryTreePage.i18n.alias.php';
135134 $wgExtensionMessagesFiles['CategoryTree'] = $dir . 'CategoryTree.i18n.php';
136135 $wgAutoloadClasses['CategoryTreePage'] = $dir . 'CategoryTreePage.php';
137136 $wgAutoloadClasses['CategoryTree'] = $dir . 'CategoryTreeFunctions.php';
Index: trunk/extensions/ParserFunctions/ParserFunctions.php
@@ -14,10 +14,11 @@
1515 'descriptionmsg' => 'pfunc_desc',
1616 );
1717
18 -$wgExtensionMessagesFiles['ParserFunctions'] = dirname(__FILE__) . '/ParserFunctions.i18n.php';
 18+$dir = dirname(__FILE__) . '/';
 19+$wgExtensionMessagesFiles['ParserFunctions'] = $dir . 'ParserFunctions.i18n.php';
1920 $wgHooks['LanguageGetMagic'][] = 'wfParserFunctionsLanguageGetMagic';
2021
21 -$wgParserTestFiles[] = dirname( __FILE__ ) . "/funcsParserTests.txt";
 22+$wgParserTestFiles[] = $dir . "funcsParserTests.txt";
2223
2324 class ExtParserFunctions {
2425 var $mExprParser;
@@ -542,4 +543,3 @@
543544 $magicWords[$word] = $trans;
544545 return true;
545546 }
546 -
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -8,9 +8,10 @@
99 * Global functions used everywhere
1010 */
1111
12 -require_once dirname(__FILE__) . '/LogPage.php';
13 -require_once dirname(__FILE__) . '/normal/UtfNormalUtil.php';
14 -require_once dirname(__FILE__) . '/XmlFunctions.php';
 12+$dir = dirname(__FILE__) . '/';
 13+require_once $dir . 'LogPage.php';
 14+require_once $dir . 'normal/UtfNormalUtil.php';
 15+require_once $dir . 'XmlFunctions.php';
1516
1617 // Hide compatibility functions from Doxygen
1718 /// @cond
Index: trunk/phase3/img_auth.php
@@ -13,9 +13,10 @@
1414 */
1515
1616 define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
17 -require_once( dirname( __FILE__ ) . '/includes/WebStart.php' );
 17+$dir = dirname(__FILE__) . '/';
 18+require_once( $dir . 'includes/WebStart.php' );
1819 wfProfileIn( 'img_auth.php' );
19 -require_once( dirname( __FILE__ ) . '/includes/StreamFile.php' );
 20+require_once( $dir . 'includes/StreamFile.php' );
2021
2122 $perms = User::getGroupPermissions( array( '*' ) );
2223 if ( in_array( 'read', $perms, true ) ) {
Index: trunk/phase3/languages/classes/LanguageKk.php
@@ -1,7 +1,8 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
5 -require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' );
 4+$dir = dirname(__FILE__) . '/';
 5+require_once( $dir . '../LanguageConverter.php' );
 6+require_once( $dir . 'LanguageKk_cyrl.php' );
67
78 define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
89 define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
Index: trunk/phase3/languages/classes/LanguageZh.deps.php
@@ -5,5 +5,6 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/LanguageZh_hans.php' );
10 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 9+$dir = dirname(__FILE__) . '/';
 10+require_once( $dir . 'LanguageZh_hans.php' );
 11+require_once( $dir . '../LanguageConverter.php' );
\ No newline at end of file
Index: trunk/phase3/languages/classes/LanguageSr.deps.php
@@ -5,5 +5,6 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
10 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 9+$dir = dirname(__FILE__) . '/';
 10+require_once( $dir . 'LanguageSr_ec.php' );
 11+require_once( $dir . '../LanguageConverter.php' );
Index: trunk/phase3/languages/classes/LanguageSr.php
@@ -1,8 +1,9 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
5 -require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
6 -require_once( dirname(__FILE__).'/LanguageSr_el.php' );
 4+$dir = dirname(__FILE__) . '/';
 5+require_once( $dir . '../LanguageConverter.php' );
 6+require_once( $dir . 'LanguageSr_ec.php' );
 7+require_once( $dir . 'LanguageSr_el.php' );
78
89 /**
910 * There are two levels of conversion for Serbian: the script level
Index: trunk/phase3/languages/classes/LanguageKk.deps.php
@@ -5,5 +5,6 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
10 -require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' );
 9+$dir = dirname(__FILE__) . '/';
 10+require_once( $dir . '../LanguageConverter.php' );
 11+require_once( $dir . 'LanguageKk_cyrl.php' );
Index: trunk/phase3/languages/classes/LanguageKu.deps.php
@@ -5,5 +5,6 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
10 -require_once( dirname(__FILE__).'/LanguageKu_ku.php' );
 9+$dir = dirname(__FILE__) . '/';
 10+require_once( $dir . '../LanguageConverter.php' );
 11+require_once( $dir . 'LanguageKu_ku.php' );
Index: trunk/phase3/languages/classes/LanguageZh.php
@@ -1,7 +1,8 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/../LanguageConverter.php' );
5 -require_once( dirname(__FILE__).'/LanguageZh_hans.php' );
 4+$dir = dirname(__FILE__) . '/';
 5+require_once( $dir . '../LanguageConverter.php' );
 6+require_once( $dir . 'LanguageZh_hans.php' );
67
78 /**
89 * @ingroup Language

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r43982Reduce dirname(__FILE__) callsaaron18:17, 26 November 2008

Comments

#Comment by Siebrand (talk | contribs)   23:37, 26 November 2008

The math made in #mediawiki tells us this saves about 2 CPU hours per day in the Wikimedia farm. Some say saving 8us per request is not worth the code change.

[00:24] <werdnum> > $st = microtime(true); for($i=0;$i<20;++$i) { $x = dirname( __FILE__ ); } $en = microtime(true); print $en-$st;
[00:24] <werdnum> 8.10623168945E-5
[00:24] <werdnum> for 20 calls per request
[00:28] <werdnum> Doing 20 very simple arithmetic operations takes the same amount of time as 20 dirname( __FILE__ )s.
[00:32] <werdnum> The code is cleaner with the cleanup
[00:32] <werdnum> *HOWEVER*, 8us per request is no justification for a code change.
[00:35] <werdnum> so I would justify the change based on cleanliness, not performance.
#Comment by Werdna (talk | contribs)   23:40, 26 November 2008

There is negligible performance benefit, but consolidating dirname(__FILE__) calls is a good idea independent of performance.

#Comment by Werdna (talk | contribs)   03:17, 30 November 2008

Reverted in r44056.


Status & tagging log