Merge "mw.loader: Optimise hot code paths in addEmbeddedCSS()"
[lhc/web/wiklou.git] / includes / content / ContentHandler.php
index 7430caf..e225fb7 100644 (file)
@@ -641,7 +641,12 @@ abstract class ContentHandler {
         *
         * @since 1.21
         *
-        * @return array Always an empty array.
+        * @return array An array mapping action names (typically "view", "edit", "history" etc.) to
+        *  either the full qualified class name of an Action class, a callable taking ( Page $page,
+        *  IContextSource $context = null ) as parameters and returning an Action object, or an actual
+        *  Action object. An empty array in this default implementation.
+        *
+        * @see Action::factory
         */
        public function getActionOverrides() {
                return [];
@@ -892,7 +897,7 @@ abstract class ContentHandler {
         * have it / want it.
         */
        public function getAutoDeleteReason( Title $title, &$hasHistory ) {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbr = wfGetDB( DB_SLAVE );
 
                // Get the last revision
                $rev = Revision::newFromTitle( $title );
@@ -922,10 +927,10 @@ abstract class ContentHandler {
 
                // Find out if there was only one contributor
                // Only scan the last 20 revisions
-               $res = $dbw->select( 'revision', 'rev_user_text',
+               $res = $dbr->select( 'revision', 'rev_user_text',
                        [
                                'rev_page' => $title->getArticleID(),
-                               $dbw->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'
+                               $dbr->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'
                        ],
                        __METHOD__,
                        [ 'LIMIT' => 20 ]
@@ -937,7 +942,7 @@ abstract class ContentHandler {
                }
 
                $hasHistory = ( $res->numRows() > 1 );
-               $row = $dbw->fetchObject( $res );
+               $row = $dbr->fetchObject( $res );
 
                if ( $row ) { // $row is false if the only contributor is hidden
                        $onlyAuthor = $row->rev_user_text;