From: Sam Reed Date: Sun, 11 Dec 2011 20:32:37 +0000 (+0000) Subject: Adding a getDB function to ApiBase... X-Git-Tag: 1.31.0-rc.0~26074 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=b8d83ec56889b1788e19b216637f77de56bc435d;p=lhc%2Fweb%2Fwiklou.git 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... --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index c2cd22b7dd..2129052afd 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1498,6 +1498,13 @@ abstract class ApiBase extends ContextSource { return $this->mDBTime; } + /** + * @return DatabaseBase + */ + public function getDB() { + return wfGetDB( DB_SLAVE, 'api' ); + } + /** * Debugging function that prints a value and an optional backtrace * @param $value mixed Value to print