aboutsummaryrefslogtreecommitdiffstats
path: root/includes/interwiki
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace wfGetLBUmherirrender2018-05-021-1/+1
| | | | | | @deprecated since 1.27 Change-Id: Ibdd49fdfc0d1511503e1ed2173a592c612996c53
* Remove superfluous spaces and semicolons in commentsFomafix2018-02-051-1/+1
| | | | Change-Id: Ib4b452f1843ec250c8c1fcc2a738d80726b6135d
* Remove leading backslashes from "use \…" tagsThiemo Mättig2017-12-281-5/+6
| | | | Change-Id: I494b029de089a07e3b946ee78293a12d5036f63e
* Fix return of Interwiki::invalidateCacheUmherirrender2017-09-101-1/+1
| | | | | | InterwikiLookup::invalidateCache does not expected a return value Change-Id: I5b2ba21ccb42ba9925205eb1645f2152fd51c0a0
* Remove empty lines at begin of function, if, foreach, switchUmherirrender2017-07-011-1/+0
| | | | | | Organize phpcs.xml a bit Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
* Merge "Fix inconsistent spec of InterwikiLookup::getAllPrefixes."jenkins-bot2017-05-043-10/+25
|\
| * Fix inconsistent spec of InterwikiLookup::getAllPrefixes.daniel2017-05-043-10/+25
| | | | | | | | | | | | | | | | | | | | The documented return type was not what existing callers expected, and not what the default implementation actually returned. This patch fixes the interface documentation and the behavior of an alternative implementation. Change-Id: Ib09bffeba3ddc5b43da1c7c299f1fa946be4e2e2
* | Interwiki: Don't override interwiki map orderTimo Tijhof2017-04-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ksort() here was causing the order to be enforced as alphabetical instead of preserving the original order. The order usually doesn't matter, except with regards to handling of duplicates. Due to Parsoid normalising external links to interwiki links, it has to do a reverse lookup. In doing so it has to decide which one to prefer. It currently picks the first match from the API request for meta=siteinfo&siprop=interwikimap, which didn't match the defined order in the actual Interwiki map due to ksort() being called in getAllPrefixes(). Sort in this function was originally introduced in 2010 with commit 844e7c83e4 (2011; r92528; T21838), which is otherwise unrelated and left no rationale. The existing unit tests needed to be adjusted slightly as they assumed alphabetical order. While it appeared they were also defined in alphabetical order, this was merely the order of the variable creation. The effective order is preserved within locals and globals, but overall globals come before locals. Also removed the duplicate test for Hash and CDB in InterwikiTest that belongs in ClassicInterwikiLookupTest instead. Bug: T145337 Change-Id: I7348748801cbdf16c6ceea5b0654fc174b79707e
* | Merge "Move Database and subclasses to Rdbms namespace"jenkins-bot2017-04-121-1/+1
|\ \
| * | Move Database and subclasses to Rdbms namespaceAaron Schulz2017-04-121-1/+1
| | | | | | | | | | | | Change-Id: I52bef87512f9ddd155d1f4cc0052f6b7a0db5b42
* | | interwiki: Remove inappropiate use of wfMemcKey()Timo Tijhof2017-04-111-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used for lookup in a CDB file or PHP static array. In neither case is the key created by wfMemcKey() or any other implementation of BagOStuff::makeKey(). This is already broken if: * An interwiki prefix were to contain characters not supported by Memcached. * An interwiki prefix and wikiid together are too long for Memcached. * If the site has wgCachePrefix configured, which overrides the wfWikiID() namespace makeKey() normally uses. dumpInterwiki.php does not use wfMemcKey() either (and should not). This was simply here as leftover from many rewrites ago, its only purpose is to create wikiid + prefix joined by colon. Ref T148958. Change-Id: I45682133ed593fbb0d66af5a67751f77f15a4a14
* / ClassicInterwikiLookup: Call static function selectFields staticallyReedy2017-04-051-2/+2
|/ | | | Change-Id: I5260ccad99057323d0f3a669a420bbd723363986
* Cleanup some incorrect return annotationsErik Bernhardson2016-12-121-1/+1
| | | | | | | | | | | | | | Most of these are simply changing annotations to reflect reality. If a function can return false to indicate failure the @return should indicate it. Some are fixing preg_match calls, preg match returns 1, 0 or false, but the functions all claim to return booleans. This is far from all the incorrect return types in mediawiki, there are around 250 detected by phan, but have to start somewhere. Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
* Fix case of MediaWikiSite in IWLookupAdapteraddshore2016-11-051-2/+2
| | | | Change-Id: Ice98cb0a3127333c045cfb4328081ad5c490c435
* Fix @since tags of changes that missed the branchaddshore2016-11-051-1/+1
| | | | | | | | | Follows: FormOptions: I29ae63472536f99f7f9546f30d86e7bd324d3094 MediaWikiServices: Ie5fd2c523ceec8cc2656e749928f38909dc4bdf1 InterwikiLookupAdapter: I387dc2ff3f5564fcedde835dec66781d8e9424fd Change-Id: I8d99d0b559d04083fb83b0fcf45cde95dab32d64
* Introduce InterwikiLookupAdapter on top of SiteLookupAmir Sarabadani2016-10-181-0/+175
| | | | | | | This adapter assumes the db name (Interwiki wiki id) equals global ids. Bug: T135146 Change-Id: I387dc2ff3f5564fcedde835dec66781d8e9424fd
* Fix doc typo in InterwikiLookupLeszek Manicki2016-09-081-1/+1
| | | | Change-Id: I2a547a005955cb9f596ff6927feb7df3d5d91872
* Rename DB_SLAVE constant to DB_REPLICAAaron Schulz2016-09-051-2/+2
| | | | | | | | | This is more consistent with LoadBalancer, modern, and inclusive of master/master mysql, NDB cluster, and MariaDB galera cluster. The old constant is an alias now. Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
* Change "slave" => "replica DB" in /includesAaron Schulz2016-09-051-1/+1
| | | | Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9
* Factor InterwikiLookup out of Interwiki class.daniel2016-05-183-322/+529
| | | | | | | | | This keeps the existing app logic for looking up interwiki information intact in ClassicInterwikiLookup. The idea is to seamlessly switch to a new implementation when it becomes available, while also allowing us to switch back in case of problems. Change-Id: I7d7424345d0ce3ce90ba284006ee9615e3d99baa
* Remove wfDebug() from getInterwikiCacheEntry()Aaron Schulz2016-05-091-1/+0
| | | | | | This is uses a fair amount of time according to flamegraphs. Change-Id: I178a590ab5de2f6fb9366ad59434d8b27dad710d
* Introduce InterwikiTestdaniel2016-04-231-8/+18
| | | | | | | | | This test class verifies that Interwiki currectly handles information from the database, CDB files, and plain arrays. This is intended to allow confident refactoring when implementing T113034. Bug: T113034 Change-Id: I2b68d11e3e946d81fa5f5f65a28fc399e7936c0f
* Convert all array() syntax to []Kunal Mehta2016-02-171-13/+13
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* interwiki: Fix-up for I5a979f047031eOri Livneh2016-02-091-8/+6
| | | | | | | | Make Interwiki::getAllPrefixesCached() work when $wgInterwikiCache is set to a static array (rather than path to a CDB file). Follows I5a979f047031e. Bug: T122362 Change-Id: I003e055471747afdcc82440490456e03cc67cc1a
* Allow $wgInterwikiCache to be an associative arrayOri Livneh2015-12-231-12/+22
| | | | | | | | | For the same reasons wikiversions.cdb was converted to a PHP file -- viz., that static arrays in PHP files get cached in HHVM's bytecode cache and are therefore faster to use with HHVM than CDB files. Bug: T122362 Change-Id: I5a979f047031ef211622f399df9b3b388797f53a
* Update getWithSetCallback() callers to the newer signatureAaron Schulz2015-10-071-2/+2
| | | | Change-Id: I1cda46178c16b7ffad97d09f8480fd57f766be57
* Change getCacheSetOptions() callers to use "Database"Aaron Schulz2015-10-051-1/+1
| | | | | | | * This is less verbose that DatabaseBase * Also add a few WAN cache doc comments Change-Id: I5b6de6d0ffa06753ea96c50b63db7dae796475dc
* Make WANObjectCache sets account for slave lagAaron Schulz2015-10-051-2/+2
| | | | | | | | | | | | | | * This gets lag information that is useful when the calling code is about to run queries that will have their results cached. * This is now used in place of trxTimestamp() for WANObjectCache set() and getWithSetCallback(). * The WAN cache will use a low TTL if the lag is too high to avoid caching stale data for weeks. * Bumped MAX_COMMIT_DELAY as nothing enforces it. Bug: T113204 Change-Id: I2a95b4088cff42d6e980351555f81a4b13519e24
* Converted Interwiki::load to using getWithSetCallback()Aaron Schulz2015-09-291-35/+21
| | | | Change-Id: I4299715ce4c996fed8add773aa03441324eb0dfc
* Converted Interwiki using WAN cacheAaron Schulz2015-04-301-4/+17
| | | | | | | * Added an invalidateCache() method for the Interwiki extension Bug: T93141 Change-Id: Id4f8b6fb9bfe26f6b5e5ce32e4e55d51eb37964d
* Replace wfRunHooks calls with direct Hooks::run callsAaron Schulz2014-12-101-1/+1
| | | | | | * This avoids the overhead of an extra function call Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
* Use cdb library and provide a back-compat layerKunal Mehta2014-11-191-0/+2
| | | | | | | | | | | | | | | The new cdb library is pulled in via composer. Since the library uses namespaces, a backwards-compatability layer is provided for the old class names: * CdbReader * CdbWriter * CdbException The PHP/DBA-specific classes should never have been used directly. Depends on I98302bdf1 in mediawiki/vendor Change-Id: I39549ac8540b262cf91f7d1830d36327afb3033d
* Cleanup some docs (includes/[e-l])umherirrender2014-07-241-2/+2
| | | | | | | | | | - Swap "$variable type" to "type $variable" - Added missing types - Fixed spacing inside docs - Makes beginning of @param/@return/@var/@throws in capital - Changed some types to match the more common spelling Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef
* Updates for Interwiki.phpSiebrand Mazeland2013-12-021-11/+52
| | | | | | | | | | * Change default type for $iwData to be the same as possible updated values * Remove superfluous else{} * Break long lines * Update documentation * Update formatting Change-Id: Ie1a655def0e9a4f71495ce5936964ef81a146297
* Improved CdbException handling in InterwikiChad Horohoe2013-11-261-60/+70
| | | | Change-Id: I6461b64dc77b3ecc641db39da1e9be306100fda3
* The static declaration must come after the visibility declarationumherirrender2013-01-261-2/+2
| | | | | | From phpcs Change-Id: Ieab0207f965630eda113abdc0259aa2eddcf5ca7
* Update doc comments and code formatting.Siebrand Mazeland2013-01-211-46/+46
| | | | Change-Id: Ib182878e08d19261d9803fd4d7e215570a2ffed4
* Interwiki::fetch can return null, false or an interwiki objectReedy2012-06-111-1/+1
| | | | Change-Id: If8c3bf0ceb2d1162cc64c0dc367ebfa4729e8f2e
* add Interwiki::selectFieldsumherirrender2012-05-111-2/+18
| | | | | | to avoid * inside select Change-Id: I9d0ac631d9389744f68d744fa1d3fa3e3866a956
* Added missing GPLv2 headers in some places.Alexandre Emsenhuber2012-05-041-1/+17
| | | | | | Also made file/class documentation more consistent. Change-Id: I1deb70318d01a257b51948ba806d80cd1a239f4f
* Documentation updatesSam Reed2012-03-051-0/+1
| | | | | | | Normalise method returns Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/113042
* Improve documentationSam Reed2012-02-021-6/+6
| | | | | | | | | Simplify if Fix whitespace Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110609
* Back out r95396 and friendsSam Reed2011-09-291-165/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/98467
* FU r98109: !EMPTY -> !NONEXISTENT (more consistent with elsewhere)Aaron Schulz2011-09-261-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/98189
* Cache negative results for interwiki prefix checks. Also helps filecache ↵Aaron Schulz2011-09-261-0/+5
| | | | | | | fail-over mode if DB is down. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/98109
* Merge the iwtransclusion branch back into trunkSam Reed2011-08-241-0/+165
| | | | | | | Hexmode fixed broken unit tests in revisions after last time Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/95396
* Followup r94353; Use !== null since that's what we use in core.Daniel Friesen2011-08-141-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94460
* Followup r94349; Interwiki::getURL used `$title != null` to test if the ↵Daniel Friesen2011-08-121-4/+4
| | | | | | | | | $title arg was passed and should be substituted. However `"" == null`, so as a result switching to using the argument broke [[mw:]] style interwiki links without an article title. Update the Interwiki::getURL code to use isset(), and update the comment to tell pre-1.19 supporting extensions to do the entire urlencoding and $1 substitution on their own since Interwiki::getURL was essentially buggy and broken before now. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94353
* Update Interwiki::getURL's first argument so that it's properly urlencoded ↵Daniel Friesen2011-08-121-1/+4
| | | | | | | | | | when replacements are made. Scanning all of core and all the extensions we have in svn, it doesn't look like anyone makes any calls to Interwiki::getURL using the argument so this should be safe enough to clean up the api. Also update Title::getFullURL to make use of the first arg now. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94349
* Back out r93533, r93531, r93530Sam Reed2011-07-301-166/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93534