r44056 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44055‎ | r44056 | r44057 >
Date:03:15, 30 November 2008
Author:werdna
Status:ok (Comments)
Tags:
Comment:
Revert "Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions."

Uses $dir in extension files, and assumes that it remains unchanged in require_once( 'maintenance/commandLine.inc' ).
In fact, it is likely that '$dir' will be set when setting up command-line, as some extensions will use the same var.

Recommended fix: Use $CentralAuth_dir, $EmailPage_dir, etc.
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/phase3/includes/GlobalFunctions.php
@@ -8,10 +8,9 @@
99 * Global functions used everywhere
1010 */
1111
12 -$dir = dirname(__FILE__) . '/';
13 -require_once $dir . 'LogPage.php';
14 -require_once $dir . 'normal/UtfNormalUtil.php';
15 -require_once $dir . 'XmlFunctions.php';
 12+require_once dirname(__FILE__) . '/LogPage.php';
 13+require_once dirname(__FILE__) . '/normal/UtfNormalUtil.php';
 14+require_once dirname(__FILE__) . '/XmlFunctions.php';
1615
1716 // Hide compatibility functions from Doxygen
1817 /// @cond
Index: trunk/phase3/img_auth.php
@@ -13,10 +13,9 @@
1414 */
1515
1616 define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
17 -$dir = dirname(__FILE__) . '/';
18 -require_once( $dir . 'includes/WebStart.php' );
 17+require_once( dirname( __FILE__ ) . '/includes/WebStart.php' );
1918 wfProfileIn( 'img_auth.php' );
20 -require_once( $dir . 'includes/StreamFile.php' );
 19+require_once( dirname( __FILE__ ) . '/includes/StreamFile.php' );
2120
2221 $perms = User::getGroupPermissions( array( '*' ) );
2322 if ( in_array( 'read', $perms, true ) ) {
Index: trunk/phase3/languages/classes/LanguageZh.php
@@ -1,8 +1,7 @@
22 <?php
33
4 -$dir = dirname(__FILE__) . '/';
5 -require_once( $dir . '../LanguageConverter.php' );
6 -require_once( $dir . 'LanguageZh_hans.php' );
 4+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 5+require_once( dirname(__FILE__).'/LanguageZh_hans.php' );
76
87 /**
98 * @ingroup Language
Index: trunk/phase3/languages/classes/LanguageKk.deps.php
@@ -5,6 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -$dir = dirname(__FILE__) . '/';
10 -require_once( $dir . '../LanguageConverter.php' );
11 -require_once( $dir . 'LanguageKk_cyrl.php' );
 9+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 10+require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' );
Index: trunk/phase3/languages/classes/LanguageKk.php
@@ -1,8 +1,7 @@
22 <?php
33
4 -$dir = dirname(__FILE__) . '/';
5 -require_once( $dir . '../LanguageConverter.php' );
6 -require_once( $dir . 'LanguageKk_cyrl.php' );
 4+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 5+require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' );
76
87 define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
98 define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
Index: trunk/phase3/languages/classes/LanguageKu.deps.php
@@ -5,6 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -$dir = dirname(__FILE__) . '/';
10 -require_once( $dir . '../LanguageConverter.php' );
11 -require_once( $dir . 'LanguageKu_ku.php' );
 9+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 10+require_once( dirname(__FILE__).'/LanguageKu_ku.php' );
Index: trunk/phase3/languages/classes/LanguageSr.php
@@ -1,9 +1,8 @@
22 <?php
33
4 -$dir = dirname(__FILE__) . '/';
5 -require_once( $dir . '../LanguageConverter.php' );
6 -require_once( $dir . 'LanguageSr_ec.php' );
7 -require_once( $dir . 'LanguageSr_el.php' );
 4+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
 5+require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
 6+require_once( dirname(__FILE__).'/LanguageSr_el.php' );
87
98 /**
109 * There are two levels of conversion for Serbian: the script level
Index: trunk/phase3/languages/classes/LanguageZh.deps.php
@@ -5,6 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -$dir = dirname(__FILE__) . '/';
10 -require_once( $dir . 'LanguageZh_hans.php' );
11 -require_once( $dir . '../LanguageConverter.php' );
\ No newline at end of file
 9+require_once( dirname(__FILE__).'/LanguageZh_hans.php' );
 10+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
Index: trunk/phase3/languages/classes/LanguageSr.deps.php
@@ -5,6 +5,5 @@
66 // changed on a subsequent page view.
77 // see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
88
9 -$dir = dirname(__FILE__) . '/';
10 -require_once( $dir . 'LanguageSr_ec.php' );
11 -require_once( $dir . '../LanguageConverter.php' );
 9+require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
 10+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
Index: trunk/extensions/Player/Player.php
@@ -44,7 +44,7 @@
4545 $wgPlayerTemplates = array();
4646 $wgPlayerVideoResolutionDetector = NULL;
4747
48 -require_once( $dir . 'PlayerDefaultSettings.php' );
 48+require_once( dirname( __FILE__ ) . '/PlayerDefaultSettings.php' );
4949
5050 function playerSetup() {
5151 global $wgParser;
Index: trunk/extensions/CategoryTree/CategoryTree.php
@@ -102,6 +102,8 @@
103103 $wgCategoryTreePageCategoryOptions['depth'] = 0;
104104 #$wgCategoryTreePageCategoryOptions['class'] = 'CategoryTreeInlineNode';
105105
 106+$wgExtensionAliasesFiles['CategoryTree'] = dirname(__FILE__) . '/CategoryTreePage.i18n.alias.php';
 107+
106108 /**
107109 * Register extension setup hook and credits
108110 */
@@ -129,7 +131,6 @@
130132 * Register the special page
131133 */
132134 $dir = dirname(__FILE__) . '/';
133 -$wgExtensionAliasesFiles['CategoryTree'] = $dir . 'CategoryTreePage.i18n.alias.php';
134135 $wgExtensionMessagesFiles['CategoryTree'] = $dir . 'CategoryTree.i18n.php';
135136 $wgAutoloadClasses['CategoryTreePage'] = $dir . 'CategoryTreePage.php';
136137 $wgAutoloadClasses['CategoryTree'] = $dir . 'CategoryTreeFunctions.php';
Index: trunk/extensions/TrustedXFF/TrustedXFF.php
@@ -10,9 +10,8 @@
1111 *
1212 * For details, see http://meta.wikimedia.org/wiki/XFF_project
1313 */
 14+$wgTrustedXffFile = dirname(__FILE__).'/trusted-xff.cdb';
1415
15 -$dir = dirname(__FILE__) . '/';
16 -$wgTrustedXffFile = $dir . 'trusted-xff.cdb';
1716
1817 /** Registration */
1918 $wgExtensionCredits['other'][] = array(
@@ -23,7 +22,7 @@
2423 'descriptionmsg' => 'trustedxff-desc',
2524 'author' => 'Tim Starling'
2625 );
27 -$wgExtensionMessagesFiles['TrustedXFF'] = $dir . 'TrustedXFF.i18n.php';
 26+$wgExtensionMessagesFiles['TrustedXFF'] = dirname(__FILE__) . '/TrustedXFF.i18n.php';
2827 $wgHooks['IsTrustedProxy'][] = 'TrustedXFF::onIsTrustedProxy';
2928
3029 class TrustedXFF {
Index: trunk/extensions/Renameuser/SpecialRenameuser.php
@@ -57,8 +57,8 @@
5858 return $rv;
5959 }
6060
61 -$wgAutoloadClasses['SpecialRenameuser'] = $dir . 'SpecialRenameuser_body.php';
62 -$wgAutoloadClasses['RenameUserJob'] = $dir . 'RenameUserJob.php';
 61+$wgAutoloadClasses['SpecialRenameuser'] = dirname( __FILE__ ) . '/SpecialRenameuser_body.php';
 62+$wgAutoloadClasses['RenameUserJob'] = dirname(__FILE__) . '/RenameUserJob.php';
6363 $wgSpecialPages['Renameuser'] = 'SpecialRenameuser';
6464 $wgSpecialPageGroups['Renameuser'] = 'users';
6565 $wgJobClasses['renameUser'] = 'RenameUserJob';
Index: trunk/extensions/BookInformation/BookInformation.php
@@ -23,16 +23,15 @@
2424 'url' => 'http://www.mediawiki.org/wiki/Extension:BookInformation',
2525 );
2626
27 -$dir = dirname(__FILE__) . '/';
28 -$wgExtensionMessagesFiles['BookInformation'] = $dir . 'BookInformation.i18n.php';
 27+$wgExtensionMessagesFiles['BookInformation'] = dirname(__FILE__) . '/BookInformation.i18n.php';
2928
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';
 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';
3433
35 -$wgAutoloadClasses['BookInformationAmazon'] = $dir . 'drivers/Amazon.php';
36 -$wgAutoloadClasses['BookInformationIsbnDb'] = $dir . 'drivers/IsbnDb.php';
 34+$wgAutoloadClasses['BookInformationAmazon'] = dirname( __FILE__ ) . '/drivers/Amazon.php';
 35+$wgAutoloadClasses['BookInformationIsbnDb'] = dirname( __FILE__ ) . '/drivers/IsbnDb.php';
3736
3837 $wgExtensionFunctions[] = 'efBookInformationSetup';
3938 $wgHooks['BookInformation'][] = 'efBookInformation';
Index: trunk/extensions/geoserver/geoserver.php
@@ -29,7 +29,7 @@
3030 $dir = dirname(__FILE__) . '/';
3131 $wgAutoloadClasses['WFS'] = $dir . 'WFS.php';
3232
33 -require_once( $dir . 'SpecialWikimaps.php' );
 33+require_once( dirname(__FILE__) . '/SpecialWikimaps.php' );
3434 /**
3535 * Called whenever a <geo> needs to be parsed
3636 *
Index: trunk/extensions/ConfigureWMF/ConfigureWMF.php
@@ -30,10 +30,9 @@
3131
3232 $wgConfigureStdlogo = '$stdlogo';
3333
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';
 34+$wgExtensionMessagesFiles['ConfigureWMF'] = dirname( __FILE__ ) . '/ConfigureWMF.i18n.php';
 35+$wgAutoloadClasses['ConfigureWMF'] = dirname( __FILE__ ) . '/ConfigureWMF.class.php';
 36+$wgAutoloadClasses['SpecialConfigure'] = dirname( __FILE__ ) . '/ConfigureWMF.page.php';
3837
3938 $wgSpecialPages['Configure'] = 'SpecialConfigure';
4039
Index: trunk/extensions/CheckUser/install.php
@@ -4,11 +4,10 @@
55 * Makes the required database changes for the CheckUser extension
66 */
77
8 -$dir = dirname(__FILE__) . '/';
98 require_once ( getenv('MW_INSTALL_PATH') !== false
109 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
11 - : $dir . '../../maintenance/commandLine.inc' );
12 -require_once $dir . 'install.inc';
 10+ : dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' );
 11+require_once dirname( __FILE__ ) . '/install.inc';
1312
1413 $db =& wfGetDB( DB_MASTER );
1514 if ( $db->tableExists( 'cu_changes' ) && !isset( $options['force'] ) ) {
Index: trunk/extensions/CheckUser/CheckUser.php
@@ -351,8 +351,9 @@
352352
353353 $wgSpecialPages['CheckUser'] = 'CheckUser';
354354 $wgSpecialPageGroups['CheckUser'] = 'users';
355 -$wgAutoloadClasses['CheckUser'] = $dir . 'CheckUser_body.php';
 355+$wgAutoloadClasses['CheckUser'] = dirname(__FILE__) . '/CheckUser_body.php';
356356
 357+
357358 function efLoadCheckUserLink( $id, $nt, &$links ) {
358359 global $wgUser;
359360 if( $wgUser->isAllowed( 'checkuser' ) ) {
Index: trunk/extensions/OpenID/OpenID.setup.php
@@ -107,8 +107,7 @@
108108
109109 $wgExtensionFunctions[] = 'setupOpenID';
110110
111 -$dir = dirname(__FILE__) . '/';
112 -$wgExtensionMessagesFiles['OpenID'] = $dir . 'OpenID.i18n.php';
 111+$wgExtensionMessagesFiles['OpenID'] = dirname(__FILE__) . '/OpenID.i18n.php';
113112
114113 $wgExtensionCredits['other'][] = array(
115114 'name' => 'OpenID',
@@ -133,17 +132,17 @@
134133
135134 # Gets stored in the session, needs to be reified before our setup
136135 $wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = OpenIDGetServerPath();
137 -$wgExtensionMessagesFiles['OpenID'] = $dir . 'OpenID.i18n.php';
 136+$wgExtensionMessagesFiles['OpenID'] = dirname(__FILE__) . '/OpenID.i18n.php';
138137 # Autoload for special pages
139138
140139 foreach (array('Login', 'Finish', 'Convert', 'Server', 'XRDS') as $sub) {
141 - $wgAutoloadClasses['SpecialOpenID' . $sub] = $dir . 'SpecialOpenID' . $sub . '.body.php';
 140+ $wgAutoloadClasses['SpecialOpenID' . $sub] = dirname(__FILE__) . '/SpecialOpenID' . $sub . '.body.php';
142141 $wgSpecialPages['OpenID'.$sub] = array('SpecialOpenID'.$sub);
143142 }
144143
145144 # Autoload common parent with utility methods
146145
147 -$wgAutoloadClasses['SpecialOpenID'] = $dir . 'SpecialOpenID.body.php';
 146+$wgAutoloadClasses['SpecialOpenID'] = dirname(__FILE__) . '/SpecialOpenID.body.php';
148147
149148 $wgHooks['PersonalUrls'][] = 'OpenIDPersonalUrls';
150149 $wgHooks['UserToggles'][] = 'OpenIDUserToggles';
Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -39,6 +39,9 @@
4040 $wgSpecialPages['ContributionStatistics'] = 'SpecialContributionStatistics';
4141 $wgSpecialPages['FundraiserStatistics'] = 'SpecialFundraiserStatistics';
4242
 43+// Shortcut to this extension directory
 44+$dir = dirname( __FILE__ ) . '/';
 45+
4346 // CutOff for fiscal year
4447 $egContributionStatisticsFiscalYearCutOff = 'July 1';
4548
@@ -83,3 +86,4 @@
8487
8588 return $db;
8689 }
 90+
Index: trunk/extensions/RandomImage/RandomImage.php
@@ -10,6 +10,8 @@
1111 */
1212
1313 if( defined( 'MEDIAWIKI' ) ) {
 14+
 15+ $wgAutoloadClasses['RandomImage'] = dirname( __FILE__ ) . '/RandomImage.class.php';
1416 $wgExtensionCredits['parserhook'][] = array(
1517 'name' => 'RandomImage',
1618 'author' => 'Rob Church',
@@ -19,10 +21,7 @@
2022 'description' => 'Provides a random media picker using <tt>&lt;randomimage /&gt;</tt>',
2123 'descriptionmsg' => 'randomimage-desc',
2224 );
23 -
24 - $dir = dirname(__FILE__) . '/';
25 - $wgAutoloadClasses['RandomImage'] = $dir . 'RandomImage.class.php';
26 - $wgExtensionMessagesFiles['RandomImage'] = $dir . 'RandomImage.i18n.php';
 25+ $wgExtensionMessagesFiles['RandomImage'] = dirname(__FILE__) . '/RandomImage.i18n.php';
2726 $wgHooks['ParserAfterStrip'][] = 'RandomImage::stripHook';
2827 $wgExtensionFunctions[] = 'efRandomImageSetup';
2928
Index: trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber.php
@@ -86,9 +86,8 @@
8787 /*
8888 * end config
8989 */
90 -$dir = dirname(__FILE__) . '/';
91 -$wgExtensionMessagesFiles['PlayerStatsGrabber'] = $dir . 'PlayerStatsGrabber.i18n.php';
92 -$wgAutoloadClasses['SpecialPlayerStatsGrabber'] = $dir . 'PlayerStatsGrabber_body.php';
 90+$wgExtensionMessagesFiles['PlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber.i18n.php';
 91+$wgAutoloadClasses['SpecialPlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber_body.php';
9392 $wgSpecialPages['PlayerStatsGrabber'] = array( 'SpecialPlayerStatsGrabber' );
9493
9594 $wgSpecialPageGroups['PlayerStatsGrabber'] = 'wiki'; // like Special:Statistics
Index: trunk/extensions/FormatDates/FormatDates.php
@@ -11,9 +11,8 @@
1212
1313 if( defined( 'MEDIAWIKI' ) ) {
1414
15 - $dir = dirname(__FILE__) . '/';
16 - $wgAutoloadClasses['DateParser'] = $dir . 'DateParser.php';
17 - $wgAutoloadClasses['FormattableDate'] = $dir . 'FormattableDate.php';
 15+ $wgAutoloadClasses['DateParser'] = dirname( __FILE__ ) . '/DateParser.php';
 16+ $wgAutoloadClasses['FormattableDate'] = dirname( __FILE__ ) . '/FormattableDate.php';
1817 $wgExtensionFunctions[] = 'efFormatDates';
1918
2019 $wgExtensionCredits['parserhook'][] = array(
Index: trunk/extensions/News/News.php
@@ -33,8 +33,8 @@
3434
3535 $wgExtensionFunctions[] = "wfNewsExtension";
3636
37 -$wgAutoloadClasses['NewsRenderer'] = $dir . 'NewsRenderer.php';
38 -$wgAutoloadClasses['NewsFeedPage'] = $dir . 'NewsRenderer.php';
 37+$wgAutoloadClasses['NewsRenderer'] = dirname( __FILE__ ) . '/NewsRenderer.php';
 38+$wgAutoloadClasses['NewsFeedPage'] = dirname( __FILE__ ) . '/NewsRenderer.php';
3939 $wgHooks['ArticleFromTitle'][] = 'wfNewsArticleFromTitle';
4040 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'wfNewsSkinTemplateOutputPageBeforeExec';
4141
Index: trunk/extensions/Makebot/Makebot.php
@@ -46,7 +46,7 @@
4747 /**
4848 * Register the special page
4949 */
50 - $wgAutoloadClasses['Makebot'] = $dir . 'Makebot.class.php';
 50+ $wgAutoloadClasses['Makebot'] = dirname( __FILE__ ) . '/Makebot.class.php';
5151 $wgSpecialPages['Makebot'] = 'Makebot';
5252 $wgSpecialPageGroups['Makebot'] = 'users';
5353
Index: trunk/extensions/ExtensionDistributor/ExtensionDistributor.php
@@ -45,10 +45,9 @@
4646 /********************
4747 * Registration
4848 */
49 -$dir = dirname(__FILE__) . '/';
5049 $wgSpecialPages['ExtensionDistributor'] = 'ExtensionDistributorPage';
51 -$wgAutoloadClasses['ExtensionDistributorPage'] = $dir . 'ExtensionDistributor_body.php';
52 -$wgExtensionMessagesFiles['ExtensionDistributor'] = $dir . 'ExtensionDistributor.i18n.php';
 50+$wgAutoloadClasses['ExtensionDistributorPage'] = dirname(__FILE__).'/ExtensionDistributor_body.php';
 51+$wgExtensionMessagesFiles['ExtensionDistributor'] = dirname(__FILE__).'/ExtensionDistributor.i18n.php';
5352
5453 $wgExtensionCredits['specialpage'][] = array(
5554 'name' => 'Extension Distributor',
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -21,14 +21,13 @@
2222 require_once( $mvgIP . '/languages/MV_Language.php' );
2323
2424 // Register special page aliases file
25 -$dir = dirname(__FILE__) . '/';
2625 $wgExtensionAliasesFiles['MetavidWiki'] = $mvgIP . '/languages/MV_Aliases.php';
2726
2827 $markerList = array();
2928
3029 // override special search page:
3130 $wgSpecialPages['Search'] = 'MV_SpecialSearch';
32 -$wgAutoloadClasses['MV_SpecialSearch'] = $dir . 'specials/MV_SpecialMediaSearch.php';
 31+$wgAutoloadClasses['MV_SpecialSearch'] = dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php';
3332
3433 function enableMetavid() {
3534 global $wgExtensionFunctions, $smwgNamespacesWithSemanticLinks;
@@ -100,55 +99,54 @@
101100 /**********************************************/
102101 /***** register autoLoad Classes: *****/
103102 /**********************************************/
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';
 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';
108106
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';
 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';
117115
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';
 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';
123121
124122
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';
 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';
131129
132 - $wgAutoloadClasses['MV_StreamImage'] = $dir . 'MV_StreamImage.php';
133 - $wgAutoloadClasses['MV_ParserCache'] = $dir . 'MV_ParserCache.php';
134 - $wgAutoloadClasses['MV_MagicWords'] = $dir . 'MV_MagicWords.php';
 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';
135133
136134 /**********************************************/
137135 /***** register special pages hooks *****/
138136 /**********************************************/
139 - $wgAutoloadClasses['MV_SpecialCRUDStream'] = $dir . 'specials/MV_SpecialCRUDStream.php';
 137+ $wgAutoloadClasses['MV_SpecialCRUDStream'] = dirname( __FILE__ ) . '/specials/MV_SpecialCRUDStream.php';
140138 $wgSpecialPages['Mv_Add_Stream'] = array( 'MV_SpecialCRUDStream' );
141139
142 - $wgAutoloadClasses['MV_SpecialListStreams'] = $dir . 'specials/MV_SpecialListStreams.php';
 140+ $wgAutoloadClasses['MV_SpecialListStreams'] = dirname( __FILE__ ) . '/specials/MV_SpecialListStreams.php';
143141 $wgSpecialPages['Mv_List_Streams'] = array( 'MV_SpecialListStreams' );
144142
145143 /* special export views */
146 - $wgAutoloadClasses['MV_SpecialExport'] = $dir . 'specials/MV_SpecialExport.php';
 144+ $wgAutoloadClasses['MV_SpecialExport'] = dirname( __FILE__ ) . '/specials/MV_SpecialExport.php';
147145
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';
 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';
153151
154152 $wgSpecialPages['MvVideoFeed'] = array( 'MvVideoFeed' );
155153 $wgSpecialPages['MvExportStream'] = array( 'MvExportStream' );
@@ -156,20 +154,20 @@
157155 $wgSpecialPages['MvExportSearch'] = array( 'MvExportSearch' );
158156 $wgSpecialPages['MvExportAsk'] = array( 'MvExportAsk' );
159157
160 - $wgAutoloadClasses['MV_SpecialMediaSearch'] = $dir . 'specials/MV_SpecialMediaSearch.php';
 158+ $wgAutoloadClasses['MV_SpecialMediaSearch'] = dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php';
161159 $wgSpecialPages['Mv_List_Streams'] = array( 'MV_SpecialListStreams' );
162160
163 - $wgAutoloadClasses['MediaSearch'] = $dir . 'specials/MV_SpecialMediaSearch.php';
 161+ $wgAutoloadClasses['MediaSearch'] = dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php';
164162 $wgSpecialPages['MediaSearch'] = array( 'MediaSearch' );
165163 $wgSpecialPages['MV_SpecialSearch'] = array( 'MV_SpecialSearch' );
166164
167 - $wgAutoloadClasses['MVAdmin'] = $dir . 'specials/MV_SpecialMVAdmin.php';
 165+ $wgAutoloadClasses['MVAdmin'] = dirname( __FILE__ ) . '/specials/MV_SpecialMVAdmin.php';
168166 $wgSpecialPages['MVAdmin'] = array( 'MVAdmin' );
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');
 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');
174172
175173 /**********************************************/
176174 /***** register hooks *****/
@@ -222,7 +220,7 @@
223221 * MV_OggHandler.php handles all the re-mapping
224222 */
225223 if($wgMediaHandlers['application/ogg'] == 'OggHandler'){
226 - $wgAutoloadClasses['mvOggHandler'] = $dir . 'MV_OggHandler.php';
 224+ $wgAutoloadClasses['mvOggHandler'] = dirname( __FILE__ ) . '/MV_OggHandler.php';
227225 $wgMediaHandlers['application/ogg']='mvOggHandler';
228226 $wgParserOutputHooks['OggHandler'] = array( 'mvOggHandler', 'outputHook' );
229227 foreach($wgHooks['LanguageGetMagic'] as & $hook_function){
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.php
@@ -18,10 +18,9 @@
1919 'descriptionmsg' => 'titleblacklist-desc',
2020 );
2121
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';
 22+$wgExtensionMessagesFiles['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.i18n.php';
 23+$wgAutoloadClasses['TitleBlacklist'] = dirname( __FILE__ ) . '/TitleBlacklist.list.php';
 24+$wgAutoloadClasses['TitleBlacklistHooks'] = dirname( __FILE__ ) . '/TitleBlacklist.hooks.php';
2625
2726 /** @defgroup Title blacklist source types
2827 * @{
Index: trunk/extensions/DumpHTML/dumpHTML.php
@@ -55,13 +55,12 @@
5656 }
5757
5858 $IP = getenv( 'MW_INSTALL_PATH' );
59 -$dir = dirname(__FILE__) . '/';
6059 if ( $IP === false ) {
61 - $IP = $dir . '../..';
 60+ $IP = dirname(__FILE__).'/../..';
6261 }
6362 require_once( $IP."/maintenance/commandLine.inc" );
64 -require_once( $dir . "dumpHTML.inc" );
65 -require_once( $dir . "SkinOffline.php" );
 63+require_once( dirname(__FILE__)."/dumpHTML.inc" );
 64+require_once( dirname(__FILE__)."/SkinOffline.php" );
6665
6766 if ( version_compare( $wgVersion, '1.11.1', '<' ) ) {
6867 echo "Error, the DumpHTML extension needs at least MediaWiki version 1.11.1 to work, you have version $wgVersion.\n";
Index: trunk/extensions/Cite/Cite.php
@@ -33,11 +33,9 @@
3434 'descriptionmsg' => 'cite_desc',
3535 'url' => 'http://www.mediawiki.org/wiki/Extension:Cite/Cite.php'
3636 );
37 -
38 -$dir = dirname(__FILE__) . '/';
39 -$wgParserTestFiles[] = $dir . "citeParserTests.txt";
40 -$wgExtensionMessagesFiles['Cite'] = $dir . "Cite.i18n.php";
41 -$wgAutoloadClasses['Cite'] = $dir . "Cite_body.php";
 37+$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt";
 38+$wgExtensionMessagesFiles['Cite'] = dirname( __FILE__ ) . "/Cite.i18n.php";
 39+$wgAutoloadClasses['Cite'] = dirname( __FILE__ ) . "/Cite_body.php";
4240 $wgSpecialPageGroups['Cite'] = 'pagetools';
4341
4442 define( 'CITE_DEFAULT_GROUP', '');
Index: trunk/extensions/BackAndForth/BackAndForth.php
@@ -12,6 +12,7 @@
1313 die( 1 );
1414 }
1515
 16+$wgAutoloadClasses['BackAndForth'] = dirname( __FILE__ ) . '/BackAndForth.class.php';
1617 $wgExtensionFunctions[] = 'efBackAndForth';
1718 $wgExtensionCredits['other'][] = array(
1819 'name' => 'Back and Forth',
@@ -23,9 +24,7 @@
2425 'url' => 'http://www.mediawiki.org/wiki/Extension:Back-and-Forth',
2526 );
2627
27 -$dir = dirname(__FILE__) . '/';
28 -$wgAutoloadClasses['BackAndForth'] = $dir . 'BackAndForth.class.php';
29 -$wgExtensionMessagesFiles['BackAndForth'] = $dir . 'BackAndForth.i18n.php';
 28+$wgExtensionMessagesFiles['BackAndForth'] = dirname(__FILE__) . '/BackAndForth.i18n.php';
3029
3130 /**
3231 * Extension setup function
Index: trunk/extensions/AntiSpoof/generateEquivset.php
@@ -1,21 +1,21 @@
22 <?php
33
4 -$dir = dirname(__FILE__) . '/';
5 -
64 require_once ( getenv('MW_INSTALL_PATH') !== false
75 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
8 - : $dir . '../../maintenance/commandLine.inc' );
 6+ : dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' );
97
 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/OpenSearchXml/OpenSearchXml.php
@@ -30,11 +30,11 @@
3131 'url' => 'http://www.mediawiki.org/wiki/Extension:OpenSearchXml'
3232 );
3333
34 -$dir = dirname(__FILE__) . '/';
35 -$wgExtensionMessagesFiles['OpenSearchXml'] = $dir . 'OpenSearchXml.i18n.php';
 34+$wgExtensionMessagesFiles['OpenSearchXml'] = dirname(__FILE__) . '/OpenSearchXml.i18n.php';
3635
3736 $wgAPIModules['opensearch'] = 'ApiOpenSearchXml';
38 -$wgAutoloadClasses['ApiOpenSearchXml'] = $dir . 'ApiOpenSearchXml.php';
 37+$wgAutoloadClasses['ApiOpenSearchXml'] =
 38+ dirname(__FILE__) . '/ApiOpenSearchXml.php';
3939
4040 $wgHooks['OpenSearchUrls'][] = 'efOpenSearchXmlUrls';
4141
Index: trunk/extensions/Configure/Configure.settings.php
@@ -38,8 +38,7 @@
3939 return;
4040 $this->initialized = true;
4141
42 - $dir = dirname(__FILE__) . '/';
43 - require( $dir . 'Configure.settings-core.php' );
 42+ require( dirname( __FILE__ ) . '/Configure.settings-core.php' );
4443 $this->settings = $settings;
4544 $this->arrayDefs = $arrayDefs;
4645 $this->emptyValues = $emptyValues;
@@ -48,7 +47,7 @@
4948 $this->notEditableSettings = $notEditableSettings;
5049 $this->settingsVersion = $settingsVersion;
5150
52 - require( $dir . 'Configure.settings-ext.php' );
 51+ require( dirname( __FILE__ ) . '/Configure.settings-ext.php' );
5352 $this->extensions = $extensions;
5453 }
5554
Index: trunk/extensions/Configure/manage.php
@@ -12,14 +12,13 @@
1313 $optionsWithArgs = array( 'revert', 'delete' );
1414 define( 'EXT_CONFIGURE_NO_EXTRACT', true );
1515
16 -$dir = dirname(__FILE__) . '/';
1716 $IP = getenv( 'MW_INSTALL_PATH' );
1817 if ( $IP === false )
19 - $IP = $dir . '../..';
 18+ $IP = dirname( __FILE__ ) . '/../..';
2019
2120 require_once( "$IP/maintenance/commandLine.inc" );
2221
23 -require_once( $dir . 'manage.inc' );
 22+require_once( dirname( __FILE__ ) . '/manage.inc' );
2423
2524 $obj = new ConfigurationManager( $options );
2625 $obj->run();
Index: trunk/extensions/Configure/migrateToDB.php
@@ -9,14 +9,13 @@
1010 * @license GPLv2 or higher
1111 */
1212
13 -$dir = dirname(__FILE__) . '/';
1413 $IP = getenv( 'MW_INSTALL_PATH' );
1514 if ( $IP === false )
16 - $IP = $dir . '../..';
 15+ $IP = dirname( __FILE__ ) . '/../..';
1716
1817 require_once( "$IP/maintenance/commandLine.inc" );
1918
20 -require_once( $dir . "migrateToDB.inc" );
 19+require_once( dirname( __FILE__ ) . "/migrateToDB.inc" );
2120
2221 $obj = new FilesToDB( $options );
2322 $obj->run();
Index: trunk/extensions/Configure/writePHP.php
@@ -11,14 +11,13 @@
1212
1313 $optionsWithArgs = array( 'wiki', 'version', 'file' );
1414
15 -$dir = dirname(__FILE__) . '/';
1615 $IP = getenv( 'MW_INSTALL_PATH' );
1716 if ( $IP === false )
18 - $IP = $dir . '../..';
 17+ $IP = dirname( __FILE__ ) . '/../..';
1918
2019 require_once( "$IP/maintenance/commandLine.inc" );
2120
22 -require_once( $dir . 'writePHP.inc' );
 21+require_once( dirname( __FILE__ ) . '/writePHP.inc' );
2322
2423 $obj = new ConfigurationWriter( $options );
2524 $obj->run();
Index: trunk/extensions/LabeledSectionTransclusion/lst.php
@@ -32,11 +32,9 @@
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';
3638
37 -$dir = dirname(__FILE__) . '/';
38 -$wgParserTestFiles[] = $dir . "lstParserTests.txt";
39 -$wgExtensionMessagesFiles['LabeledSectionTransclusion'] = $dir . 'lst.i18n.php';
40 -
4139 // Local settings variable
4240 // Must be set now to avoid injection via register_globals
4341 $wgLstLocal = null;
Index: trunk/extensions/AjaxQueryPages/Load.php
@@ -19,12 +19,11 @@
2020 'descriptionmsg' => 'ajax-qp-desc',
2121 );
2222
23 - $dir = dirname(__FILE__) . '/';
24 - $wgExtensionMessagesFiles['AjaxQueryPages'] = $dir . 'AjaxQueryPages.i18n.php';
 23+ $wgExtensionMessagesFiles['AjaxQueryPages'] = dirname(__FILE__) . '/AjaxQueryPages.i18n.php';
2524
2625 // Load hooks
27 - require_once( $dir . 'Hooks.php');
 26+ require_once(dirname(__FILE__) . '/Hooks.php');
2827
2928 // Set up AJAX entry point:
30 - require_once( $dir . 'Response.php');
 29+ require_once(dirname(__FILE__) . '/Response.php');
3130 }
Index: trunk/extensions/Babel/Babel.php
@@ -39,20 +39,18 @@
4040 $wgHooks[ 'LanguageGetMagic' ][] = 'BabelStatic::Magic';
4141 $wgHooks[ 'AbortNewAccount' ][] = 'BabelAutoCreate::RegisterAbort';
4242
43 -$dir = dirname(__FILE__) . '/';
44 -
4543 // Register internationalisation file.
46 -$wgExtensionMessagesFiles[ 'Babel' ] = $dir . 'Babel.i18n.php';
 44+$wgExtensionMessagesFiles[ 'Babel' ] = dirname( __FILE__ ) . '/Babel.i18n.php';
4745
4846 // Register autoload classes.
49 -$wgAutoloadClasses[ 'Babel' ] = $dir . 'Babel.class.php';
50 -$wgAutoloadClasses[ 'BabelStatic' ] = $dir . 'BabelStatic.class.php';
51 -$wgAutoloadClasses[ 'BabelAutoCreate' ] = $dir . 'BabelAutoCreate.class.php';
 47+$wgAutoloadClasses[ 'Babel' ] = dirname( __FILE__ ) . '/Babel.class.php';
 48+$wgAutoloadClasses[ 'BabelStatic' ] = dirname( __FILE__ ) . '/BabelStatic.class.php';
 49+$wgAutoloadClasses[ 'BabelAutoCreate' ] = dirname( __FILE__ ) . '/BabelAutoCreate.class.php';
5250
5351 // Configuration setttings.
5452 $wgBabelUseLevelZeroCategory = false;
5553 $wgBabelUseSimpleCategories = false;
5654 $wgBabelUseMainCategories = true;
5755 $wgLanguageCodesFiles = array();
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
 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
Index: trunk/extensions/FileSearch/FileSearch.php
@@ -12,10 +12,9 @@
1313 if( defined( 'MEDIAWIKI' ) ) {
1414
1515 $wgExtensionFunctions[] = 'efFileSearchSetup';
16 - $dir = dirname(__FILE__) . '/';
17 - $wgAutoloadClasses['FileSearchIndexer'] = $dir . 'FileSearchIndexer.php';
18 - $wgAutoloadClasses['Extractor'] = $dir . 'extract/Extractor.php';
19 - $wgFileSearchExtractors['TextExtractor'] = $dir . 'extract/TextExtractor.php';
 16+ $wgAutoloadClasses['FileSearchIndexer'] = dirname( __FILE__ ) . '/FileSearchIndexer.php';
 17+ $wgAutoloadClasses['Extractor'] = dirname( __FILE__ ) . '/extract/Extractor.php';
 18+ $wgFileSearchExtractors['TextExtractor'] = dirname( __FILE__ ) . '/extract/TextExtractor.php';
2019
2120 function efFileSearchSetup() {
2221 global $wgHooks;
Index: trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php
@@ -177,6 +177,7 @@
178178 return true;
179179 }
180180
 181+$dir = dirname(__FILE__) . '/';
181182 # Request an account
182183 $wgSpecialPages['RequestAccount'] = 'RequestAccountPage';
183184 $wgAutoloadClasses['RequestAccountPage'] = $dir . 'RequestAccount_body.php';
Index: trunk/extensions/Poem/Poem.php
@@ -32,11 +32,9 @@
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';
3638
37 -$dir = dirname(__FILE__) . '/';
38 -$wgParserTestFiles[] = $dir . "poemParserTests.txt";
39 -$wgExtensionMessagesFiles['Poem'] = $dir . 'Poem.i18n.php';
40 -
4139 function wfPoemExtension() {
4240 $GLOBALS['wgParser']->setHook("poem","PoemExtension");
4341 return true;
Index: trunk/extensions/GroupPermissionsManager/GroupPermissionsManager_body.php
@@ -283,8 +283,7 @@
284284 */
285285 private function writeFile( $type ) {
286286 //can we write the file?
287 - $dir = dirname(__FILE__) . '/';
288 - if(!is_writable( $dir . "config" )) {
 287+ if(!is_writable( dirname(__FILE__) . "/config" )) {
289288 echo( "<h2>Cannot write config file, aborting</h2>
290289
291290 <p>In order to use this extension, you need to make the /config subdirectory of this extension
@@ -294,8 +293,8 @@
295294 die( 1 );
296295 }
297296 $this->oldrev = gmdate('dmYHis');
298 - if(file_exists( $dir . 'config/GroupPermissions.php')) {
299 - $r = rename( $dir . 'config/GroupPermissions.php', $dir . 'config/GroupPermissions.' . $this->oldrev . '.php');
 297+ if(file_exists(dirname(__FILE__) . '/config/GroupPermissions.php')) {
 298+ $r = rename(dirname(__FILE__) . '/config/GroupPermissions.php', dirname(__FILE__) . '/config/GroupPermissions.' . $this->oldrev . '.php');
300299 if(!$r) {
301300 global $wgOut;
302301 $wgOut->addWikiText(wfMsg('grouppermissions-nooldrev'));
@@ -398,7 +397,7 @@
399398 }
400399
401400 $grouppermissions = str_replace( "\r\n", "\n", $grouppermissions );
402 - chdir( $dir . "config" );
 401+ chdir( dirname(__FILE__) . "/config" );
403402 $f = fopen( "GroupPermissions.php", 'wt' );
404403 if(fwrite( $f, $grouppermissions ) ) {
405404 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( $dir . '/config/SortPermissions.php');
 46+ require(dirname(__FILE__).'/config/SortPermissions.php');
4747 }
4848 }
4949 $this->makeForm();
@@ -132,9 +132,7 @@
133133 */
134134 private function writeFile() {
135135 //can we write the file?
136 - $dir = dirname(__FILE__) . '/';
137 -
138 - if(!is_writable( $dir . "config" )) {
 136+ if(!is_writable( dirname(__FILE__) . "/config" )) {
139137 echo( "<h2>Cannot write config file, aborting</h2>
140138
141139 <p>In order to use this extension, you need to make the /config subdirectory of this extension
@@ -144,8 +142,8 @@
145143 die( 1 );
146144 }
147145 $this->oldrev = gmdate('dmYHis');
148 - if(file_exists( $dir . 'config/SortPermissions.php')) {
149 - $r = rename( $dir . 'config/SortPermissions.php', $dir . 'config/SortPermissions.' . $this->oldrev . '.php');
 146+ if(file_exists(dirname(__FILE__) . '/config/SortPermissions.php')) {
 147+ $r = rename(dirname(__FILE__) . '/config/SortPermissions.php', dirname(__FILE__) . '/config/SortPermissions.' . $this->oldrev . '.php');
150148 if(!$r) {
151149 global $wgOut;
152150 $wgOut->addWikiText(wfMsg('grouppermissions-nooldrev'));
@@ -209,7 +207,7 @@
210208 $sortpermissions .= "\n\$wgGPManagerSort['$key'] = array($st);";
211209 }
212210 $sortpermissions = str_replace( "\r\n", "\n", $sortpermissions );
213 - chdir( $dir . 'config' );
 211+ chdir( dirname(__FILE__) . '/config' );
214212 $f = fopen( 'SortPermissions.php', 'wt' );
215213 if(!fwrite( $f, $sortpermissions ) ) {
216214 echo('<p class="error">An error occured while writing the config/SortPermissions.php file. Check user rights and disk space then try again.</p>');
@@ -219,9 +217,9 @@
220218 fclose($f);
221219 if($nr !== array()) {
222220 $np = '';
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');
 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');
226224 if(!$r) {
227225 global $wgOut;
228226 $wgOut->addWikiText(wfMsg('grouppermissions-nooldrev'));
Index: trunk/extensions/GroupPermissionsManager/GetMessages.php
@@ -10,13 +10,12 @@
1111 }
1212
1313 global $wgExtensionMessagesFiles;
14 -$dir = dirname(__FILE__) . '/';
15 -require( $dir . 'GroupPermissionsManager.i18n.php');
 14+require(dirname(__FILE__) . '/GroupPermissionsManager.i18n.php');
1615
17 -$files = scandir( $dir . 'plugins/messages');
 16+$files = scandir(dirname(__FILE__) . '/plugins/messages');
1817 foreach($files as $file) {
1918 if(preg_match('/\.i18n\.php5?$/i', $file)) {
20 - $wgExtensionMessagesFiles[$file] = $dir . 'plugins/messages/' . $file;
 19+ $wgExtensionMessagesFiles[$file] = dirname(__FILE__) . '/plugins/messages/' . $file;
2120 wfLoadExtensionMessages($file);
2221 }
2322 }
Index: trunk/extensions/AntiBot/AntiBot.php
@@ -40,10 +40,8 @@
4141 'description' => 'Simple framework for spambot checks and trigger payloads',
4242 'descriptionmsg' => 'antibot-desc',
4343 );
 44+$wgExtensionMessagesFiles['AntiBot'] = dirname(__FILE__) . '/AntiBot.i18n.php';
4445
45 -$dir = dirname(__FILE__) . '/';
46 -$wgExtensionMessagesFiles['AntiBot'] = $dir . 'AntiBot.i18n.php';
47 -
4846 /**
4947 * A map of payload types to callbacks
5048 * This may be extended by plugins.
@@ -55,7 +53,7 @@
5654 );
5755
5856 # Load plugins
59 -foreach ( glob( $dir . 'active/*.php' ) as $file ) {
 57+foreach ( glob( dirname( __FILE__ ) . '/active/*.php' ) as $file ) {
6058 require( $file );
6159 }
6260
Index: trunk/extensions/EmailPage/EmailPage.php
@@ -22,14 +22,13 @@
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/
2627
27 -$dir = dirname(__FILE__) . '/';
28 -$wgPhpMailerClass = $dir . 'phpMailer_v2.1.0beta2/class.phpmailer.php'; # From http://phpmailer.sourceforge.net/
29 -
3028 if ($wgEmailPageGroup) $wgGroupPermissions['sysop'][$wgEmailPageGroup] = true;
3129
3230 if (isset($_SERVER['SERVER_ADDR'])) $wgEmailPageAllowRemoteAddr[] = $_SERVER['SERVER_ADDR'];
3331
 32+$dir = dirname(__FILE__) . '/';
3433 $wgAutoloadClasses['SpecialEmailPage'] = $dir . 'EmailPage_body.php';
3534 $wgExtensionMessagesFiles['EmailPage'] = $dir . 'EmailPage.i18n.php';
3635 $wgExtensionAliasesFiles['EmailPage'] = $dir . 'EmailPage.alias.php';
Index: trunk/extensions/ParserFunctions/ParserFunctions.php
@@ -14,11 +14,10 @@
1515 'descriptionmsg' => 'pfunc_desc',
1616 );
1717
18 -$dir = dirname(__FILE__) . '/';
19 -$wgExtensionMessagesFiles['ParserFunctions'] = $dir . 'ParserFunctions.i18n.php';
 18+$wgExtensionMessagesFiles['ParserFunctions'] = dirname(__FILE__) . '/ParserFunctions.i18n.php';
2019 $wgHooks['LanguageGetMagic'][] = 'wfParserFunctionsLanguageGetMagic';
2120
22 -$wgParserTestFiles[] = $dir . "funcsParserTests.txt";
 21+$wgParserTestFiles[] = dirname( __FILE__ ) . "/funcsParserTests.txt";
2322
2423 class ExtParserFunctions {
2524 var $mExprParser;
@@ -543,3 +542,4 @@
544543 $magicWords[$word] = $trans;
545544 return true;
546545 }
 546+
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php
@@ -42,11 +42,9 @@
4343 */
4444 $optionsWithArgs = array( 'b', 'user', 'password');
4545
46 -$dir = dirname(__FILE__) . '/';
47 -
4846 require_once ( getenv('MW_INSTALL_PATH') !== false
4947 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
50 - : $dir . '../../../maintenance/commandLine.inc' );
 48+ : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' );
5149 require_once("$IP/maintenance/counter.php");
5250
5351 global $smwgDefaultStore;
@@ -77,7 +75,7 @@
7876
7977 global $smwgIP;
8078 if (! isset($smwgIP))
81 - $smwgIP = $dir . '..';
 79+ $smwgIP = dirname(__FILE__) . '/..';
8280
8381 require_once($smwgIP . '/includes/SMW_GlobalFunctions.php');
8482
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_conceptCache.php
@@ -14,11 +14,9 @@
1515
1616 $optionsWithArgs = array( 'concept', 'old', 's', 'e');
1717
18 -$dir = dirname(__FILE__) . '/';
19 -
2018 require_once ( getenv('MW_INSTALL_PATH') !== false
2119 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
22 - : $dir . '../../../maintenance/commandLine.inc' );
 20+ : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' );
2321 require_once("$IP/maintenance/counter.php");
2422
2523 $output_level = array_key_exists('quiet', $options)?0:
@@ -96,7 +94,7 @@
9795
9896 global $smwgIP;
9997 if (! isset($smwgIP))
100 - $smwgIP = $dir . '..';
 98+ $smwgIP = dirname(__FILE__) . '/..';
10199
102100 require_once($smwgIP . '/includes/SMW_GlobalFunctions.php');
103101
Index: trunk/extensions/cldr/LanguageNames.body.php
@@ -60,10 +60,8 @@
6161 private static function loadLanguage( $code ) {
6262 if ( !isset(self::$cache[$code]) ) {
6363
64 - $dir = dirname(__FILE__) . '/';
65 -
6664 /** Load override for wrong or missing entries in cldr */
67 - $override = $dir . self::getOverrideFileName( $code );
 65+ $override = dirname(__FILE__) . '/' . self::getOverrideFileName( $code );
6866 if ( file_exists( $override ) ) {
6967 $names = false;
7068 require( $override );
@@ -72,7 +70,7 @@
7371 }
7472 }
7573
76 - $filename = $dir . self::getFileName( $code );
 74+ $filename = dirname(__FILE__) . '/' . self::getFileName( $code );
7775 if ( file_exists( $filename ) ) {
7876 $names = false;
7977 require( $filename );
Index: trunk/extensions/ConfirmEdit/FancyCaptcha.php
@@ -37,6 +37,6 @@
3838 global $wgCaptchaSecret;
3939 $wgCaptchaSecret = "CHANGE_THIS_SECRET!";
4040
41 -$dir = dirname(__FILE__) . '/';
42 -$wgExtensionMessagesFiles['FancyCaptcha'] = $dir . 'FancyCaptcha.i18n.php';
43 -$wgAutoloadClasses['FancyCaptcha'] = $dir . 'FancyCaptcha.class.php';
 41+$wgExtensionMessagesFiles['FancyCaptcha'] = dirname(__FILE__).'/FancyCaptcha.i18n.php';
 42+$wgAutoloadClasses['FancyCaptcha'] = dirname( __FILE__ ) . '/FancyCaptcha.class.php';
 43+

Past revisions this follows-up on

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

Comments

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

Forgot to mention in the commit message, the reverted code was r43987.

Status & tagging log