Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git] / includes / filebackend / filejournal / DBFileJournal.php
index 7efb3a1..62e635d 100644 (file)
@@ -22,6 +22,8 @@
  * @author Aaron Schulz
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Version of FileJournal that logs to a DB table
  * @since 1.20
@@ -48,10 +50,10 @@ class DBFileJournal extends FileJournal {
         * @see FileJournal::logChangeBatch()
         * @param array $entries
         * @param string $batchId
-        * @return Status
+        * @return StatusValue
         */
        protected function doLogChangeBatch( array $entries, $batchId ) {
-               $status = Status::newGood();
+               $status = StatusValue::newGood();
 
                try {
                        $dbw = $this->getMasterDB();
@@ -151,11 +153,11 @@ class DBFileJournal extends FileJournal {
 
        /**
         * @see FileJournal::purgeOldLogs()
-        * @return Status
+        * @return StatusValue
         * @throws DBError
         */
        protected function doPurgeOldLogs() {
-               $status = Status::newGood();
+               $status = StatusValue::newGood();
                if ( $this->ttlDays <= 0 ) {
                        return $status; // nothing to do
                }
@@ -180,7 +182,7 @@ class DBFileJournal extends FileJournal {
        protected function getMasterDB() {
                if ( !$this->dbw ) {
                        // Get a separate connection in autocommit mode
-                       $lb = wfGetLBFactory()->newMainLB();
+                       $lb =  MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->newMainLB();
                        $this->dbw = $lb->getConnection( DB_MASTER, [], $this->wiki );
                        $this->dbw->clearFlag( DBO_TRX );
                }