Commit graph

71 commits

Author SHA1 Message Date
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Sam Reed
5bfce03820 More documentation of parameters following up r104591 2011-12-05 16:50:58 +00:00
Sam Reed
39356de1a4 Moar documentations 2011-11-29 21:04:20 +00:00
Sam Reed
27665d27ae Update some deprecated code
Documentation

Fix "/*" comments to "/**"

Flesh out some missing returns, change some return types
2011-10-14 21:18:38 +00:00
Sam Reed
4d8c6dee24 Moar documentations 2011-09-16 17:58:50 +00:00
Sam Reed
e960fc9b39 Merge r90266 to trunk
Fixes fixme on r75341, r75343
2011-09-07 23:21:41 +00:00
Tim Starling
23f8346ce7 Further updates for r90643/r95647 in core and extensions. Fixed all callers of Database::getLag(), made them call a new function LoadBalancer::safeGetLag() instead, which doesn't cause fatal errors for non-replicated installations. The core updates are tested but the extension updates aren't. 2011-08-29 05:04:55 +00:00
Tim Starling
a3bf5ecb4a * Fix for r90643: in the case where there is only one server, implying no replication, make LoadBalancer::getLagTimes(), LoadMonitor_MySQL::getLagTimes() and LoadBalancer::getMaxLag() quickly report zero lag without attempting to do a SHOW SLAVE STATUS query.
* Updated the documentation to make it clear that REPLICATION CLIENT is required in a replicated setup. 
* Reverted r90773.
2011-08-29 04:42:26 +00:00
Sam Reed
8712062c94 Fix documentation (clearing w/c) 2011-08-24 12:47:42 +00:00
Sam Reed
7a06cb7d58 Add in \n from/to r95055 to LoadBalancer.php
Differentiate error messages from r95050 per Hashar
2011-08-21 15:24:44 +00:00
Sam Reed
5a2afad3b0 Upstream wikia changes 2011-08-19 23:19:26 +00:00
Chad Horohoe
498213cc9f Merge live hack - Extra debugging on connection failures 2011-08-01 23:28:06 +00:00
Tim Starling
0e73205470 General database-related code cleanup:
* Merged the 4 simulated implementations of Database*::replace(). I took diffs, they were nearly identical. I made one based on the IBM DB2 version, since it used insert() which looked like a nice touch.
* Provided the non-simulated implementation of Database*::replace() via a protected member function, and made DatabaseMysql::replace() and DatabaseSqlite::replace() into a wrapper for it. 
* Moved the MySQL-specific functionality from masterPosWait(), getSlavePos() and getMasterPos() from DatabaseBase to DatabaseMysql. 
* Renamed getStatus() to getMysqlStatus() and moved it to DatabaseMysql. Removed "unimplemented" errors from two other subclasses. Really there's no way another DBMS could or should implement this function. 
* Split the LoadMonitor class into a no-op class and a MySQL-specific class, to avoid fatal errors due to the getMysqlStatus() call if other DBMSs tried to use LoadBalancer with multiple servers. Of course there are lots of other reasons it won't work, I'm just fixing the architecture issue here.

And while I have a replicated test setup handy:
* On MySQL 4.1.9 and later, use SHOW SLAVE STATUS to get the lag instead of SHOW PROCESSLIST. This has the advantage of reading zero when there are no events for a while.
2011-06-23 03:14:11 +00:00
Tim Starling
8371ede86b Fixes for r80864 for 1.18 backport:
* Use camel case in tableName and dbName, dontrunallyourwordstogetherlikethis
* Call the function factory() instead of newFromType(), for consistency with the rest of MediaWiki
2011-06-20 07:00:50 +00:00
Sam Reed
4ffe712c84 Fix trailing whitespace 2011-06-17 15:59:55 +00:00
Sam Reed
fe611d4dc6 * (bug 29267) always give the servername for meta=siteinfo&siprop=dbrepllag 2011-06-03 22:59:34 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Sam Reed
6fac268c19 Documentation 2011-05-25 18:41:31 +00:00
Sam Reed
33ad682ab0 Add/remove/tweak method documentation 2011-05-19 00:03:31 +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
Brian Wolff
fb1c2b7d26 Follow up r86363 - Missing a dollar sign.
Fixes the: Notice: Use of undefined constant i - assumed 'i' in /var/www/w/phase3/includes/db/LoadBalancer.php on line 745
2011-05-02 07:42:14 +00:00
Alexandre Emsenhuber
e7660a8654 * Changed wfMsgNoDBForContent() call to wfMessage(); also switched to user's language, I don't see any reason to not display this in user's language
* Marked wfMsgNoDBForContent() as deprecated and added wfDeprecated() call; the call in LoadBalancer was the only one in core and extensions
* Also added call to wfDeprecated() in wfMsgWeirdKey(); no call in core or extensions
2011-04-19 06:21:06 +00:00
Sam Reed
cdf75379c9 Apply LoadBalancer related fixes
Patches by Yuvi Panda

From (bug 28583) Remove all /* private */ declarations in MediaWiki core
2011-04-18 23:12:58 +00:00
Sam Reed
01891953bc More function/member variable documentation 2011-03-09 17:09:10 +00:00
Sam Reed
e30476fd0c Followup r83558, r83555
Set default of false to $open parameter
2011-03-09 16:37:39 +00:00
Roan Kattouw
c4bcbc22c9 Merge r83555 from 1.17wmf1: fix wait for slaves code from r83529 2011-03-09 00:24:21 +00:00
Roan Kattouw
ff6fec1e6f Make updateCollation.php a bit less murderous for WMF databases:
* Don't run a COUNT(*) query on what's potentially the entire categorylinks table on enwiki (hundreds of millions of rows). Put it in a miser mode check
* Wait for DB replication to catch up before processing the next batch. Implemented LoadBalancer::waitAll() for this purpose, which should behave more nicely than wfWaitForSlaves()
2011-03-08 16:47:26 +00:00
Platonides
49074e8a56 Yet more additions of wfProfileOut() 2011-02-10 16:39:53 +00:00
Alexandre Emsenhuber
c2379cd884 Fix for r80864: the $dbname variable was not there only to make pretty debug output, but also to let the connection choose the correct database. This was breaking connections to other databases since they were always using wiki's database. 2011-01-24 18:45:59 +00:00
Chad Horohoe
b3e99eec5b Followup to r79848 (and really, make it useful...)
Turn DatabaseBase::classFromType() into newFromType() factory function for constructing a new object based on a given type and (optional) params. Documented it fairly clearly.

I think it looks nicer :)
2011-01-24 16:31:36 +00:00
Sam Reed
bb29dc588d (bug 26895) in /include/db/LoadBalancer.php function "closeConnecton" should be called "closeConnection"
Seemingly no callers in extensions OR phase3 (weird...), searching for "closeConnecton" or the correctly spelt "closeConnection"

The back-compat typo thing probably wants removing.. Seems to have been as such since it was added in r32578...
2011-01-24 01:00:29 +00:00
Chad Horohoe
97b62e3034 Add DatabaseBase::classFromType() to reduce the 'Database' . $type duplication 2011-01-07 22:32:52 +00:00
Alexandre Emsenhuber
54b82541b4 Fix for r79231: $dbname was missing 2010-12-30 07:24:41 +00:00
Sam Reed
8180764a47 Extract sucks
Wrap long line
2010-12-30 02:48:27 +00:00
Roan Kattouw
e9f29660a8 Fix bug in load balancer: filter out non-replicating slaves (or slaves otherwise not reporting their lag) even if no max lag is specified 2010-11-27 22:39:56 +00:00
Roan Kattouw
ebd644480f Fix typo in LoadBalancer.php 2010-11-27 22:36:05 +00:00
Chad Horohoe
ae0df98c32 rm unused and (seemingly) broken factory function 2010-11-23 16:11:28 +00:00
Max Semenik
64089af28a Removed LoadBalancer::getGroupIndex(): deprecated since r32578, no callers 2010-11-23 12:27:02 +00:00
Sam Reed
d189aaee05 (bug 24853) Kill failFunction - Fixed! :D 2010-10-24 21:27:33 +00:00
Sam Reed
16cded8b32 Start of bug 24853, killing off 'functional' parts of failfunction code. Seems when the constructors start getting changed, it starts borking. Using this as a point of reversion/stashing 2010-10-24 20:48:48 +00:00
Antoine Musso
478768939c Follow up r74962, debug messages should be splitted.
This is to avoid log mess with concurrent accesses and to allow logging between the messages.

Makes the message more readeable:
  Connecting to localhost wikidb...
  Connected to localhost wikidb.
  Connection failed to localhost wikidb.
2010-10-19 06:27:25 +00:00
Antoine Musso
f720cbd4a4 Make some wfDebug() messages nicer to look at in debug log file. 2010-10-18 19:56:33 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +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
Sam Reed
85af1b0901 Revert r71250 r71251 r71252 r71253
Know what the problem is, roughly, can't fix atm, so not leaving phase3 broken
2010-08-18 14:15:32 +00:00
Sam Reed
9ea1f1d388 Kill some crappy "failFunction" stuff, marked as old in r14625 2010-08-18 13:38:42 +00:00
Sam Reed
380b6725d5 Remove some unused variables
Move variable in languages/classes/LanguageKu.php into commented code (used in comment)
2010-08-13 20:58:16 +00:00
Jeroen De Dauw
bf13f7ff9a Added some docs 2010-08-10 06:17:49 +00:00
Alexandre Emsenhuber
fb36e6ac3e * standardised file headers
* added a basic description
* added @file
2010-08-08 11:55:47 +00:00