r61775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61774‎ | r61775 | r61776 >
Date:04:55, 1 February 2010
Author:mah
Status:reverted
Tags:
Comment:
Fix parsertests so that they work even when server-side thumbnailing isn't configured.
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/Namespace.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.inc (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)
  • /trunk/phase3/tests/MediaWikiParserTest.php (modified) (history)
  • /trunk/phase3/tests/MediaWiki_TestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.inc
@@ -640,6 +640,7 @@
641641 'wgNoFollowLinks' => true,
642642 'wgNoFollowDomainExceptions' => array(),
643643 'wgThumbnailScriptPath' => false,
 644+ 'wgUseImageResize' => false,
644645 'wgUseTeX' => false,
645646 'wgLocaltimezone' => 'UTC',
646647 'wgAllowExternalImages' => true,
Index: trunk/phase3/maintenance/parserTests.txt
@@ -3283,7 +3283,7 @@
32843284 !! input
32853285 [[Image:foobar.jpg|thumb|http://example.com]]
32863286 !! result
3287 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
 3287+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
32883288
32893289 !! end
32903290
@@ -3292,7 +3292,7 @@
32933293 !! input
32943294 [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]]
32953295 !! result
3296 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
 3296+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
32973297
32983298 !! end
32993299
@@ -3301,7 +3301,7 @@
33023302 !! input
33033303 [[Image:foobar.jpg|thumb|ISBN 1235467890]]
33043304 !! result
3305 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="https://www.mediawiki.org/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
 3305+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="https://www.mediawiki.org/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
33063306
33073307 !! end
33083308
@@ -3310,7 +3310,7 @@
33113311 !! input
33123312 [[Image:foobar.jpg|thumb|This is RFC 12354]]
33133313 !! result
3314 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a href="http://tools.ietf.org/html/rfc12354" class="external mw-magiclink-rfc">RFC 12354</a></div></div></div>
 3314+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a href="http://tools.ietf.org/html/rfc12354" class="external mw-magiclink-rfc">RFC 12354</a></div></div></div>
33153315
33163316 !! end
33173317
@@ -3319,7 +3319,7 @@
33203320 !! input
33213321 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
33223322 !! result
3323 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
 3323+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
33243324
33253325 !! end
33263326
@@ -3329,7 +3329,7 @@
33303330 !! input
33313331 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
33323332 !! result
3333 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
 3333+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
33343334
33353335 !! end
33363336
@@ -3340,7 +3340,7 @@
33413341 !! input
33423342 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
33433343 !! result
3344 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><span class="texhtml">2 + 2</span></div></div></div>
 3344+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><span class="texhtml">2 + 2</span></div></div></div>
33453345
33463346 !! end
33473347
@@ -3413,7 +3413,7 @@
34143414 !! input
34153415 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
34163416 !! result
3417 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">File:Icon.png</a> inside it!</div></div></div>
 3417+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">File:Icon.png</a> inside it!</div></div></div>
34183418
34193419 !! end
34203420
@@ -3433,7 +3433,7 @@
34343434 !! input
34353435 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
34363436 !! result
3437 -<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a href="irc://example.net" class="external text" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" rel="nofollow">Secure</a> ext links in it.</div></div></div>
 3437+<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="200" height="23" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a href="irc://example.net" class="external text" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" rel="nofollow">Secure</a> ext links in it.</div></div></div>
34383438
34393439 !! end
34403440
@@ -6381,7 +6381,7 @@
63826382 !! input
63836383 [[Image:foobar.jpg|640x480px]]
63846384 !! result
6385 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6385+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
63866386 </p>
63876387 !!end
63886388
@@ -6390,7 +6390,7 @@
63916391 !! input
63926392 [[Image:foobar.jpg|640px]]
63936393 !! result
6394 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6394+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
63956395 </p>
63966396 !!end
63976397
@@ -6399,7 +6399,7 @@
64006400 !! input
64016401 [[Image:foobar.jpg|640px ]]
64026402 !! result
6403 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6403+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
64046404 </p>
64056405 !!end
64066406
@@ -6408,7 +6408,7 @@
64096409 !! input
64106410 [[Image:foobar.jpg| 640px]]
64116411 !! result
6412 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6412+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
64136413 </p>
64146414 !!end
64156415
@@ -6450,7 +6450,7 @@
64516451 !! input
64526452 [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
64536453 !! result
6454 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="An external URL" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a href="http://test/?param1=|left|&amp;param2=|x" class="external text" rel="nofollow">external</a> URL</div></div></div>
 6454+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="An external URL" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a href="http://test/?param1=|left|&amp;param2=|x" class="external text" rel="nofollow">external</a> URL</div></div></div>
64556455
64566456 !!end
64576457
@@ -7351,7 +7351,7 @@
73527352 !! input
73537353 [[Image:Foobar.jpg|thumb|http://x|hello]]
73547354 !! result
7355 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>hello</div></div></div>
 7355+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>hello</div></div></div>
73567356
73577357 !! end
73587358
Index: trunk/phase3/tests/MediaWiki_TestCase.php
@@ -7,7 +7,10 @@
88 */
99 protected function buildTestDatabase( $tables ) {
1010 global $testOptions, $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
11 - $this->markTestIncomplete("This test requires DB admin user credentials.");
 11+ if(!$wgDBadminuser || !$wgDBadminpassword) {
 12+ $this->markTestIncomplete("This test requires DB admin user credentials.");
 13+ }
 14+
1215 $wgDBprefix = 'parsertest_';
1316
1417 $db = new DatabaseMysql(
@@ -16,7 +19,8 @@
1720 $wgDBadminpassword,
1821 $wgDBname );
1922 if( $db->isOpen() ) {
20 - if (!(strcmp($db->getServerVersion(), '4.1') < 0 and stristr($db->getSoftwareLink(), 'MySQL'))) {
 23+ if (!(strcmp($db->getServerVersion(), '4.1') < 0 and
 24+ stristr($db->getSoftwareLink(), 'MySQL'))) {
2125 # Database that supports CREATE TABLE ... LIKE
2226 foreach ($tables as $tbl) {
2327 $newTableName = $db->tableName( $tbl );
@@ -41,7 +45,6 @@
4246 }
4347 $db->query($create_tmp);
4448 }
45 -
4649 }
4750 return $db;
4851 } else {
Index: trunk/phase3/tests/MediaWikiParserTest.php
@@ -23,7 +23,6 @@
2424
2525 function showSuccess( $desc ) {
2626 $this->cb->assertTrue( true, $desc );
27 - echo "PASSED: $desc\n";
2827 return true;
2928 }
3029
@@ -146,21 +145,10 @@
147146 $wgStyleSheetPath = '/skins';
148147 $wgStylePath = '/skins';
149148 $wgThumbnailScriptPath = false;
150 - $this->uploadDir = $this->setupUploadDir();
151 - $wgLocalFileRepo = array(
152 - 'class' => 'LocalRepo',
153 - 'name' => 'local',
154 - 'directory' => $this->uploadDir,
155 - 'url' => 'http://example.com/images',
156 - 'hashLevels' => 2,
157 - 'transformVia404' => false,
158 - );
159 - //$wgNamespacesWithSubpages = array( 0 => isset( $opts['subpage'] ) );
160149 $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface';
161150 $wgNamespaceAliases['Image'] = NS_FILE;
162151 $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
163152
164 -
165153 $wgEnableParserCache = false;
166154 $wgDeferredUpdateList = array();
167155 $wgMemc =& wfGetMainCache();
@@ -181,35 +169,8 @@
182170 $this->parserTester = new PTShell();
183171 $this->parserTester->setCallback( $this );
184172
185 - /* global $wgDBtype, $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword, $wgDBport, $wgDBmwschema, $wgDBts2chema; */
186 - /* $this->db['type'] = $wgDBtype; */
187 - /* $this->db['server'] = $wgDBserver; */
188 - /* $this->db['name'] = $wgDBname; */
189 - /* $this->db['user'] = $wgDBuser; */
190 - /* $this->db['password'] = $wgDBpassword; */
191 - /* $this->db['port'] = $wgDBport; */
192 - /* $this->db['mwschema'] = $wgDBmwschema; */
193 - /* $this->db['ts2schema'] = $wgDBts2chema; */
194173 }
195174
196 - function tearDown() {
197 - $this->teardownUploadDir($this->uploadDir);
198 - /* $db = wfGetDB( DB_MASTER ); */
199 - /* $db->close(); */
200 - /* global $wgDBtype, $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword, $wgDBport, $wgDBmwschema, $wgDBts2chema; */
201 -
202 - /* $wgDBtype = $this->db['type']; */
203 - /* $wgDBserver = $this->db['server']; */
204 - /* $wgDBname = $this->db['name']; */
205 - /* $wgDBuser = $this->db['user']; */
206 - /* $wgDBpassword = $this->db['password']; */
207 - /* $wgDBport = $this->db['port']; */
208 - /* $wgDBmwschema = $this->db['mwschema']; */
209 - /* $wgDBts2chema = $this->db['ts2schema']; */
210 -
211 - }
212 -
213 -
214175 function testParser() {
215176 global $IP;
216177
Index: trunk/phase3/includes/MessageCache.php
@@ -399,16 +399,18 @@
400400
401401 // Also delete cached sidebar... just in case it is affected
402402 global $parserMemc;
403 - $codes = array( $code );
404 - if ( $code === 'en' ) {
405 - // Delete all sidebars, like for example on action=purge on the
406 - // sidebar messages
407 - $codes = array_keys( Language::getLanguageNames() );
408 - }
 403+ if(is_object($parserMemc)) {
 404+ $codes = array( $code );
 405+ if ( $code === 'en' ) {
 406+ // Delete all sidebars, like for example on action=purge on the
 407+ // sidebar messages
 408+ $codes = array_keys( Language::getLanguageNames() );
 409+ }
409410
410 - foreach ( $codes as $code ) {
411 - $sidebarKey = wfMemcKey( 'sidebar', $code );
412 - $parserMemc->delete( $sidebarKey );
 411+ foreach ( $codes as $code ) {
 412+ $sidebarKey = wfMemcKey( 'sidebar', $code );
 413+ $parserMemc->delete( $sidebarKey );
 414+ }
413415 }
414416
415417 wfRunHooks( "MessageCacheReplace", array( $title, $text ) );
Index: trunk/phase3/includes/Title.php
@@ -3451,7 +3451,12 @@
34523452 * @return \type{\string} String representation of this title
34533453 */
34543454 public function __toString() {
3455 - return $this->getPrefixedText();
 3455+ $bt = debug_backtrace();
 3456+ foreach($bt as $b) {
 3457+ print "{$b['file']}:{$b['line']}\n";
 3458+ }
 3459+ exit;
 3460+ return $this->getPrefixedText();
34563461 }
34573462
34583463 /**
Index: trunk/phase3/includes/Namespace.php
@@ -8,6 +8,7 @@
99 * Definitions of the NS_ constants are in Defines.php
1010 * @private
1111 */
 12+global $wgCanonicalNamespaceNames;
1213 $wgCanonicalNamespaceNames = array(
1314 NS_MEDIA => 'Media',
1415 NS_SPECIAL => 'Special',

Follow-up revisions

RevisionCommit summaryAuthorDate
r61777follow up r61775 (reapply): Fix parsertests so that they work even when serve...mah04:59, 1 February 2010

Status & tagging log