/**
* Get the Database object used in getTitleInfo().
*
- * Defaults to the local slave DB. Subclasses may want to override this to return a foreign
+ * Defaults to the local replica DB. Subclasses may want to override this to return a foreign
* database object, or null if getTitleInfo() shouldn't access the database.
*
* NOTE: This ONLY works for getTitleInfo() and isKnownEmpty(), NOT FOR ANYTHING ELSE.
* @return IDatabase|null
*/
protected function getDB() {
- return wfGetDB( DB_SLAVE );
+ return wfGetDB( DB_REPLICA );
}
/**
return $this->titleInfo[$key];
}
+ /**
+ * @return string
+ */
public function getPosition() {
return $this->position;
}
+
+ /**
+ * @since 1.28
+ * @return string
+ */
+ public function getType() {
+ // Check both because subclasses don't always pass pages via the constructor,
+ // they may also override getPages() instead, in which case we should keep
+ // defaulting to LOAD_GENERAL and allow them to override getType() separately.
+ return ( $this->styles && !$this->scripts ) ? self::LOAD_STYLES : self::LOAD_GENERAL;
+ }
}