Explicitly allow lines up to 100 chars in Rubocop
[lhc/web/wiklou.git] / includes / specialpage / QueryPage.php
index 52e4299..1ff7e3f 100644 (file)
@@ -60,7 +60,6 @@ abstract class QueryPage extends SpecialPage {
         * @return array
         */
        public static function getPages() {
-               global $wgDisableCounters;
                static $qp = null;
 
                if ( $qp === null ) {
@@ -82,7 +81,7 @@ abstract class QueryPage extends SpecialPage {
                                array( 'MostimagesPage', 'Mostimages' ),
                                array( 'MostinterwikisPage', 'Mostinterwikis' ),
                                array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ),
-                               array( 'MostlinkedtemplatesPage', 'Mostlinkedtemplates' ),
+                               array( 'MostlinkedTemplatesPage', 'Mostlinkedtemplates' ),
                                array( 'MostlinkedPage', 'Mostlinked' ),
                                array( 'MostrevisionsPage', 'Mostrevisions' ),
                                array( 'FewestrevisionsPage', 'Fewestrevisions' ),
@@ -97,15 +96,11 @@ abstract class QueryPage extends SpecialPage {
                                array( 'WantedFilesPage', 'Wantedfiles' ),
                                array( 'WantedPagesPage', 'Wantedpages' ),
                                array( 'WantedTemplatesPage', 'Wantedtemplates' ),
-                               array( 'UnwatchedPagesPage', 'Unwatchedpages' ),
+                               array( 'UnwatchedpagesPage', 'Unwatchedpages' ),
                                array( 'UnusedtemplatesPage', 'Unusedtemplates' ),
                                array( 'WithoutInterwikiPage', 'Withoutinterwiki' ),
                        );
-                       wfRunHooks( 'wgQueryPages', array( &$qp ) );
-
-                       if ( !$wgDisableCounters ) {
-                               $qp[] = array( 'PopularPagesPage', 'Popularpages' );
-                       }
+                       Hooks::run( 'wgQueryPages', array( &$qp ) );
                }
 
                return $qp;
@@ -325,7 +320,7 @@ abstract class QueryPage extends SpecialPage {
                                                        'qc_value' => $value );
                                }
 
-                               $dbw->begin( __METHOD__ );
+                               $dbw->startAtomic( __METHOD__ );
                                # Clear out any old cached data
                                $dbw->delete( 'querycache', array( 'qc_type' => $this->getName() ), $fname );
                                # Save results into the querycache table on the master
@@ -337,7 +332,7 @@ abstract class QueryPage extends SpecialPage {
                                $dbw->insert( 'querycache_info',
                                        array( 'qci_type' => $this->getName(), 'qci_timestamp' => $dbw->timestamp() ),
                                        $fname );
-                               $dbw->commit( __METHOD__ );
+                               $dbw->endAtomic( __METHOD__ );
                        }
                } catch ( DBError $e ) {
                        if ( !$ignoreErrors ) {
@@ -351,7 +346,7 @@ abstract class QueryPage extends SpecialPage {
 
        /**
         * Get a DB connection to be used for slow recache queries
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function getRecacheDB() {
                return wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) );
@@ -406,7 +401,7 @@ abstract class QueryPage extends SpecialPage {
                        $res = $dbr->query( $sql, $fname );
                }
 
-               return $dbr->resultObject( $res );
+               return $res;
        }
 
        /**
@@ -581,7 +576,7 @@ abstract class QueryPage extends SpecialPage {
         *
         * @param OutputPage $out OutputPage to print to
         * @param Skin $skin User skin to use
-        * @param DatabaseBase $dbr Database (read) connection to use
+        * @param IDatabase $dbr Database (read) connection to use
         * @param ResultWrapper $res Result pointer
         * @param int $num Number of available result rows
         * @param int $offset Paging offset
@@ -654,7 +649,7 @@ abstract class QueryPage extends SpecialPage {
 
        /**
         * Do any necessary preprocessing of the result object.
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param ResultWrapper $res
         */
        function preprocessResults( $db, $res ) {