Commit graph

27 commits

Author SHA1 Message Date
Aaron Schulz
4a74dbf198 Converted Interwiki using WAN cache
* Added an invalidateCache() method for the Interwiki extension

Bug: T93141
Change-Id: Id4f8b6fb9bfe26f6b5e5ce32e4e55d51eb37964d
2015-04-30 01:33:22 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Kunal Mehta
987d2e4c77 Use cdb library and provide a back-compat layer
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
2014-11-19 18:39:27 +00:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- 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
2014-07-24 19:43:03 +02:00
Siebrand Mazeland
3cb6887bca Updates for Interwiki.php
* 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
2013-12-02 12:00:01 +01:00
Chad Horohoe
e7404af422 Improved CdbException handling in Interwiki
Change-Id: I6461b64dc77b3ecc641db39da1e9be306100fda3
2013-11-26 15:28:39 -08:00
umherirrender
9d6575af15 The static declaration must come after the visibility declaration
From phpcs

Change-Id: Ieab0207f965630eda113abdc0259aa2eddcf5ca7
2013-01-26 21:03:52 +01:00
Siebrand Mazeland
02aa6edd3d Update doc comments and code formatting.
Change-Id: Ib182878e08d19261d9803fd4d7e215570a2ffed4
2013-01-21 21:45:13 +00:00
Reedy
e38706a0e1 Interwiki::fetch can return null, false or an interwiki object
Change-Id: If8c3bf0ceb2d1162cc64c0dc367ebfa4729e8f2e
2012-06-11 23:04:02 +01:00
umherirrender
38a2cd320a add Interwiki::selectFields
to avoid * inside select

Change-Id: I9d0ac631d9389744f68d744fa1d3fa3e3866a956
2012-05-11 22:16:19 +02:00
Alexandre Emsenhuber
63176b99b7 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1deb70318d01a257b51948ba806d80cd1a239f4f
2012-05-04 08:47:07 +02:00
Sam Reed
08e4a19369 Documentation updates
Normalise method returns
2012-03-05 15:23:04 +00:00
Sam Reed
6454687806 Improve documentation
Simplify if

Fix whitespace
2012-02-02 20:19:20 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +00:00
Aaron Schulz
50305c2864 FU r98109: !EMPTY -> !NONEXISTENT (more consistent with elsewhere) 2011-09-26 22:46:40 +00:00
Aaron Schulz
8ecde9b038 Cache negative results for interwiki prefix checks. Also helps filecache fail-over mode if DB is down. 2011-09-26 03:37:20 +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
Daniel Friesen
ecd274f432 Followup r94353; Use !== null since that's what we use in core. 2011-08-14 14:20:59 +00:00
Daniel Friesen
b7474f0743 Followup r94349; Interwiki::getURL used $title != null to test if the $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.
2011-08-12 14:55:25 +00:00
Daniel Friesen
d5dfd2b066 Update Interwiki::getURL's first argument so that it's properly urlencoded 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.
2011-08-12 14:10:37 +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
Robin Pepermans
d898a5fa86 Fixes for r92538 & r92528:
* use default null for $local
* use foreach for database result
2011-07-21 22:19:23 +00:00
Robin Pepermans
472801ecfa Follow-up r92528:
* remove @static
* return database result directly (no need for while())
* getAllPrefixesDb() -> getAllPrefixesDB()
2011-07-19 15:52:38 +00:00
Robin Pepermans
844e7c83e4 (bug 19838) API does not use interwiki cache.
Patch by Beau; modified to work with current code.
2011-07-19 12:30:18 +00:00
Daniel Friesen
1afb94ee5c Allow rows missing iw_trans or iw_local to be considered valid. 2011-04-23 03:10:57 +00:00
Daniel Friesen
99c94d0c7c Move the Interwiki class to includes/interwiki/ to make way for a more flexible Interwiki system. Do this first since svn doesn't support editing and moving a file in the same commit. 2011-04-23 02:35:21 +00:00