r105823 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105822‎ | r105823 | r105824 >
Date:20:32, 11 December 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Adding a getDB function to ApiBase...

Not all subclasses will need/want it. It does however make it easier to pretend non ApiQuery derivatives actually are...
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiBase.php
@@ -1499,6 +1499,13 @@
15001500 }
15011501
15021502 /**
 1503+ * @return DatabaseBase
 1504+ */
 1505+ public function getDB() {
 1506+ return wfGetDB( DB_SLAVE, 'api' );
 1507+ }
 1508+
 1509+ /**
15031510 * Debugging function that prints a value and an optional backtrace
15041511 * @param $value mixed Value to print
15051512 * @param $name string Description of the printed value

Follow-up revisions

RevisionCommit summaryAuthorDate
r105826Followup r105823, make it protectedreedy20:41, 11 December 2011

Comments

#Comment by Duplicatebug (talk | contribs)   18:51, 17 December 2011

What about caching like ApiQuery?

#Comment by Reedy (talk | contribs)   19:24, 17 December 2011

Well, the users from non ApiQuery derivatives are few and far between

If we're going to do that, we might aswell just pull the getDB method from ApiQuery into ApiBase and remove the duplication

Status & tagging log