LoadMonitor: Avoid "host not replicating?" log messages by checking "is static"
[lhc/web/wiklou.git] / includes / specials / SpecialMostcategories.php
index a0dbcf0..06d21d5 100644 (file)
@@ -34,7 +34,7 @@ class MostcategoriesPage extends QueryPage {
                parent::__construct( $name );
        }
 
-       function isExpensive() {
+       public function isExpensive() {
                return true;
        }
 
@@ -42,22 +42,30 @@ class MostcategoriesPage extends QueryPage {
                return false;
        }
 
-       function getQueryInfo() {
-               return array(
-                       'tables' => array( 'categorylinks', 'page' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'COUNT(*)' ),
-                       'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces() ),
-                       'options' => array( 'HAVING' => 'COUNT(*) > 1',
-                               'GROUP BY' => array( 'page_namespace', 'page_title' ) ),
-                       'join_conds' => array( 'page' => array( 'LEFT JOIN',
-                                       'page_id = cl_from' ) )
-               );
+       public function getQueryInfo() {
+               return [
+                       'tables' => [ 'categorylinks', 'page' ],
+                       'fields' => [
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'COUNT(*)'
+                       ],
+                       'conds' => [ 'page_namespace' => MWNamespace::getContentNamespaces() ],
+                       'options' => [
+                               'HAVING' => 'COUNT(*) > 1',
+                               'GROUP BY' => [ 'page_namespace', 'page_title' ]
+                       ],
+                       'join_conds' => [
+                               'page' => [
+                                       'LEFT JOIN',
+                                       'page_id = cl_from'
+                               ]
+                       ]
+               ];
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param ResultWrapper $res
         */
        function preprocessResults( $db, $res ) {
@@ -84,8 +92,15 @@ class MostcategoriesPage extends QueryPage {
        function formatResult( $skin, $result ) {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$title ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+                       return Html::element(
+                               'span',
+                               [ 'class' => 'mw-invalidtitle' ],
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title
+                               )
+                       );
                }
 
                if ( $this->isCached() ) {