Commit graph

32 commits

Author SHA1 Message Date
jeroendedauw
dc8f3e6c78 Added a pile of missing brackets
Change-Id: Id7b331e1b12875736c8e7e93660e71630360a723
2012-09-27 21:46:22 +02:00
Aaron Schulz
e40a90f0bc Added some doc comments for BacklinkCache.
Change-Id: I71201582726c986384fe9fba60a5bdc7fa465be8
2012-09-10 23:32:12 -07:00
Aaron Schulz
af89b09a06 Limit the Title backlink cache to two instances.
Change-Id: I1e17a3de20d7c84a9818a850d4b7cc2898f72dc2
2012-09-03 12:45:50 -07:00
Alexandre Emsenhuber
44ec396481 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ife63db5d36d833de4e0944f9b79ab0f80e7b84c5
2012-05-22 20:43:10 +02:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Antoine Musso
c1f23144e1 using real identity for hashar
Converting my pseudonym to use my real identity instead:
Ashar Voultoiz -> Antoine Musso
2011-10-24 09:08:13 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +00:00
Sam Reed
ad39f2da86 Trim trailing whitespace
Add/tweak/update documentation

Simplify some boolean returns
2011-09-04 21:40:17 +00:00
Sam Reed
7268b417d0 Followup r95396
Swap $wgGlobalDB for $wgGlobalDatabase
2011-08-31 15:00:23 +00:00
Sam Reed
44020e254c Merge the iwtransclusion branch back into trunk
Hexmode fixed broken unit tests in revisions after last time
2011-08-24 13:03:03 +00:00
Victor Vasiliev
80a7648a42 Allow extensions to run their own backlink-based updates:
* Introduce new hooks which allow BacklinkCache to handle non-core tables
* Make table name a parameter to RefreshLinks2 job (instead of hardcoded templatelinks)
2011-08-13 22:42:09 +00:00
Sam Reed
183d2dab37 Back out r93533, r93531, r93530
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean

ArticleTablesTest testbug14404

Error:
ArticleTablesTest::testbug14404
Undefined offset: 0

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

ParserTests testParserTest #552 - testParserTest with data set #551

Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
 </p>

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
2011-07-30 15:56:54 +00:00
Sam Reed
dc9d39887e Merge iwtransclusion branch into trunk 2011-07-30 15:30:01 +00:00
Brian Wolff
aafdf047f2 (Follow-up r91059) Make backlinks query do both null or "" to potentially account for old rows that havn't been updated
yet to new conventions.

Hopefully I got the syntax right for the OR thing using mw's db functions (I tested the query, its fine, I'm just not 100% sure thats the most correct way using mw's db funcs, I've never really had to build an OR query using the db funcs).
2011-06-29 23:09:00 +00:00
Brian Wolff
bf2587f024 BacklinkCache was forgetting to check rd_interwiki when getting redirects, and thus getting
some extranous backlinks for the redirect table (if there happened to be a page redirecting
to an interwiki page with the same name plus an interwiki prefix).

Not a major issue since this is really only used as far as i can tell, to purge squids and html file cache.
A couple of extra unneeded purges shouldn't hurt anything, just a bit pointless.
2011-06-29 07:19:12 +00:00
Antoine Musso
e42fed1b8f Fix comment in BacklinkCache::partition()
+ a typo

Per cr on r84254
2011-06-26 11:48:55 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Sam Reed
8775ac3b20 Type hinting
Braces

Remove extra whitespace
2011-04-25 21:25:45 +00:00
Antoine Musso
ec0f5ae496 BacklinkCache: explicit properties visibility 2011-03-18 18:16:38 +00:00
Antoine Musso
af86e56356 documentation for BacklinkCache class
- still need examples
- could use peer review
- no functional changes
2011-03-18 18:12:58 +00:00
Max Semenik
84d86f3116 Reverted r70151 and re-did what it was intended to do in a proper way: instead of just quietly serializing a crippled connection, fix the caller and receive nice exceptions when something else is broken instead of bug-hunting later. 2010-10-23 11:16:44 +00:00
Brion Vibber
2f360ee0f9 Revert r74286, r74287 -- broke parserTests completely; mixed lots of formatting and code cleanup in with functional changes making it impossible to review cleanly. 2010-10-05 15:10:14 +00:00
Mark A. Hershberger
a828027890 (second commit to get all files.)
= BacklinkCache.php =
* BacklinkCache class
** Set a few otherwise unset varables ($wgContLang & $wgMemc in
   BacklinkCache)
= testHelpers.inc =
* TectRecorder class
** TestRecorder::record() accept and use a recorder object
** change TestFileIterator::setParser use a MediaWikiParserTest instead
   of ParserTest
= parserTest.inc =
* ParserTest class
** Make $ParserTest->regex and $ParsaerTest->savedGlobals member
   variables available to stop warnings.
** Force ParserTest::$showProgress and $showFailure to false
** Set ParserTest::$uploadDir on time
** Move ParserTest::chomp() and addArticle() to bootstrap for
   MediaWikiTestSetup.
** Update ParserTest::runTest so that Success and Failure are reported
   via reporter->showsTestResult() or ParserTestSuiteBackend::show*()
   as needed.
** Set $ParserTest->uploadDir with setupUploadDir()
** Change ParserTest->setupGlobals() so that $wgDBprefix doesn't get
   to set to the “parsertest_” bits.
** Sprinkle $this->teardownGlobals() at exit points in
  ParserTest->teardownDatabase()
= bootstrap.php =
* MediaWikiTestSetup class
** Make member variables MediaWikiTestSetup::$suite,
  MediaW* Make member variables MediaWikiTestSetup::$suite,
  MediaWikiTestSetup::$regex, MediaWikiTestSetup::$runDisabled
  available.
* Setup a constructor MediaWikiTestSetup that accepts an optional
  PHPUnit_Framework_TestSuite so they can use PHPUnit.
* Change MediaWikiParserTest so that it is derived from
  MediaWikiTestSetup instead of PHPUnit_Framework_TestSuite
* Make MediaWikiParserTest create a PHPUnit_Framework_TestSuite for
  the parser tests and pass it to the new parent (MediaWikiTestSetup)
  as the PHPUnit testsuite.
* Replace MediaWikiParserTest->run() with MediaWikiParserTest::suite()
  so that the tests can be loaded into a suite and then run with
  PHPUnit's test runner.
= ParserHelpers.php =
* ParserUnitTest class
** Force run() $backend to use ParserTestSuiteBackend instead of
   trying to get the  backend from the suite member.
** Use ParserTest::runTest() instead of
  ParserikiTestSetup::$regex, MediaWikiTestSetup::$runDisabled
  available.
** Setup a constructor MediaWikiTestSetup that accepts an optional
   PHPUnit_Framework_TestSuite so they can use PHPUnit.
** Change MediaWikiParserTest so that it is derived from
   MediaWikiTestSetup instead of PHPUnit_Framework_TestSuite
** Make MediaWikiParserTest create a PHPUnit_Framework_TestSuite for
   the parser tests and pass it to the new parent (MediaWikiTestSetup)
   as the PHPUnit testsuite.
** Replace MediaWikiParserTest->run() with MediaWikiParserTest::suite()
   so that the tests can be loaded into a suite and then run with
   PHPUnit's test runner.
= ParserHelpers.php =
* ParserUnitTest class
** Force run() $backend to use ParserTestSuiteBackend instead of
   trying to get the  backend from the suite member.
** Use ParserTest::runTest() instead of
  ParserTestSuiteBackend::runTest()
* ParserTestSuiteBackend class
** extends PHPUnit_FrameWork_TestSuite instead of ParserTest
** Add member variables  $recorder, $term, and $usePHPUnit
** Add a constructor that determines if PHPUnit is usewd.
** Add a method showTestResult() that can be used to show success or
   failure
** Change showSucess and showFailure() to be static and use identical
   arguments and only use PHPUnit_Framework_Assert::assertEquals
   when PHPUnit is in use.
= SearchEngineTest.php =
** Fix path in require to bootstrap.php
2010-10-05 03:51:49 +00:00
Siebrand Mazeland
d279df340e Ran stylize.php, removed trailing whitespace, updated indentation and code formatting. 2010-05-30 14:48:30 +00:00
Siebrand Mazeland
f8b1c4cfb7 Random indentation and code formatting updates. No functional changes. 2010-02-14 22:07:30 +00:00
Alexandre Emsenhuber
60a11e5035 Fix some doxygen warnings 2010-01-05 21:24:23 +00:00
Tim Starling
1eae9941d9 Fix bug in BacklinkCache: the lack of an ORDER BY clause in getLinks(), combined with the lack of sensible indexes on the categorylinks table, was causing partition() to return starts and ends scaterred randomly across the result set. For large jobs, many partitions end up being large, causing HTMLCacheUpdate::doPartialUpdate() to repartition, thus requeueing jobs in an infinite recursive loop.
The BacklinkCache bug was there since r47317, but was relatively harmless until r54841 introduced the infinite loop issue.
2009-12-04 01:55:05 +00:00
Domas Mituzas
7303df44a2 I have no idea why I'm doing this, but this has to be done, force order on *links,page reads 2009-02-19 10:38:42 +00:00
Tim Starling
4f3efbf406 Don't do any backlink batches if there are no backlinks. 2009-02-19 02:10:55 +00:00
Tim Starling
4b66381cbf * Mostly reverted r41081 and related. Although the motivation (to save a query) is noble, it's a complex special case relying on subtle inter-module effects, making the code quite unclear and the performance advantage hard to reproduce in new code.
* r41081 was causing the job queue to be flooded with tiny htmlCacheUpdate jobs which were less than the batch size and so, according to the original logic, should have been done immediately. This was causing template updates to be delayed even when the template has few backlinks. This is fixed.
* Introduced a shared cache called BacklinkCache with the main purpose of sharing data from these backlink queries, thus recovering the performance of r41081.
* Refactored backlink partitioning code, which in r40741 was copied from HTMLCacheUpdate to LinksUpdate with a bug intact. The bug caused every htmlCacheUpdate or refreshLinks2 job to be split into at least two pieces even when number of rows is less than the batch size.
* Fixed a bug from r40741 causing refreshLinks2 jobs with end=false to be ignored.
* Made SquidUpdate::newFromTitles() accept a TitleArray
2009-02-16 14:26:34 +00:00