Make LocalFile check early if the revision store is available
[lhc/web/wiklou.git] / includes / Storage / RevisionStore.php
index 2140209..db06afe 100644 (file)
@@ -132,6 +132,13 @@ class RevisionStore
                $this->logger = $logger;
        }
 
+       /**
+        * @return bool Whether the store is read-only
+        */
+       public function isReadOnly() {
+               return $this->blobStore->isReadOnly();
+       }
+
        /**
         * @return bool
         */
@@ -252,7 +259,7 @@ class RevisionStore
                        if ( $title ) {
                                $this->logger->info(
                                        __METHOD__ . ' fell back to READ_LATEST and got a Title.',
-                                       [ 'trace' => wfDebugBacktrace() ]
+                                       [ 'trace' => wfBacktrace() ]
                                );
                                return $title;
                        }
@@ -298,8 +305,8 @@ class RevisionStore
        }
 
        /**
-        * Insert a new revision into the database, returning the new revision ID
-        * number on success and dies horribly on failure.
+        * Insert a new revision into the database, returning the new revision record
+        * on success and dies horribly on failure.
         *
         * MCR migration note: this replaces Revision::insertOn
         *
@@ -740,8 +747,6 @@ class RevisionStore
 
                        if ( isset( $row->rev_text_id ) && $row->rev_text_id > 0 ) {
                                $mainSlotRow->cont_address = 'tt:' . $row->rev_text_id;
-                       } elseif ( isset( $row->ar_id ) ) {
-                               $mainSlotRow->cont_address = 'ar:' . $row->ar_id;
                        }
 
                        if ( isset( $row->old_text ) ) {