-
- protected function getContent( $page, $ns ) {
- if ( $ns === NS_MEDIAWIKI ) {
- return wfEmptyMsg( $page ) ? '' : wfMsgExt( $page, 'content' );
+
+ /**
+ * Get the Database object used in getTitleMTimes(). Defaults to the local slave DB
+ * but subclasses may want to override this to return a remote DB object, or to return
+ * null if getTitleMTimes() shouldn't access the DB at all.
+ *
+ * NOTE: This ONLY works for getTitleMTimes() and getModifiedTime(), NOT FOR ANYTHING ELSE.
+ * In particular, it doesn't work for getting the content of JS and CSS pages. That functionality
+ * will use the local DB irrespective of the return value of this method.
+ *
+ * @return DatabaseBase|null
+ */
+ protected function getDB() {
+ return wfGetDB( DB_SLAVE );
+ }
+
+ /**
+ * @param $title Title
+ * @return null|string
+ */
+ protected function getContent( $title ) {
+ if ( $title->getNamespace() === NS_MEDIAWIKI ) {
+ // The first "true" is to use the database, the second is to use the content langue
+ // and the last one is to specify the message key already contains the language in it ("/de", etc.)
+ $text = MessageCache::singleton()->get( $title->getDBkey(), true, true, true );
+ return $text === false ? '' : $text;