* (bug 14473) Add iwlinks table to track inline interwiki link usage
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 16 Apr 2010 01:40:05 +0000 (01:40 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 16 Apr 2010 01:40:05 +0000 (01:40 +0000)
commit8eac509ab5ebb7276dffffa0092f8722146c5003
treeb0160943fba3d368d869e53d508562fde30df434
parent42079ec7780ddc8330fcf5fe1c1d95272cf2b9c0
* (bug 14473) Add iwlinks table to track inline interwiki link usage

Like langlinks, this stores the interwiki prefix (as iwl_prefix) and full page title (as iwl_title), attached to the page doing the liking (as iwl_from -> page_id).
Unlike langlinks, there can be multiple entries stored per interwiki prefix.

Updater to add the table confirmed on MySQL, untested on SQLite but should work.
Someone may still need to add and test a PostgreSQL updater.

Refactored makeWhereFrom2d() out of LinkBatch to Database so it could be re-used for the similar mapping for the interwiki links, which need a string prefix rather than an int namespace key.
Also cleaned it up internally to reuse existing code for building where clauses from arrays. (Tim & Domas -- if the previous more verbose code was there to reduce function call and array processing overhead on very large link lists, feel free to unroll it again if the difference is measurable. Just swap the var names around from the old LinkBatch code and escape the base key value if it's not an integer, it'll be functionally equivalent.)
includes/LinkBatch.php
includes/LinksUpdate.php
includes/db/Database.php
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/parser/ParserOutput.php
maintenance/archives/patch-iwlinks.sql [new file with mode: 0644]
maintenance/parserTests.inc
maintenance/tables.sql
maintenance/updaters.inc