* (bug 27763) Article::getParserOutput() no longer throws a fatal given when an incor...
[lhc/web/wiklou.git] / includes / QueryPage.php
index 9078e63..2dc9ac6 100644 (file)
@@ -130,7 +130,7 @@ abstract class QueryPage extends SpecialPage {
        function getQueryInfo() {
                return null;
        }
-       
+
        /**
         * For back-compat, subclasses may return a raw SQL query here, as a string.
         * This is stronly deprecated; getQueryInfo() should be overridden instead.
@@ -274,7 +274,7 @@ abstract class QueryPage extends SpecialPage {
                if ( !$this->isCacheable() ) {
                        return 0;
                }
-               
+
                $fname = get_class( $this ) . '::recache';
                $dbw = wfGetDB( DB_MASTER );
                $dbr = wfGetDB( DB_SLAVE, array( $this->getName(), __METHOD__, 'vslow' ) );
@@ -381,9 +381,9 @@ abstract class QueryPage extends SpecialPage {
        }
 
        /**
-        * Parameters and order changed in 1.18
+        * Somewhat deprecated, you probably want to be using execute()
         */
-       function doQuery( $limit, $offset = false ) {
+       function doQuery( $offset = false, $limit = false ) {
                if ( $this->isCached() && $this->isCacheable() ) {
                        return $this->fetchFromCache( $limit, $offset );
                } else {
@@ -552,8 +552,9 @@ abstract class QueryPage extends SpecialPage {
 
                if ( $num > 0 ) {
                        $html = array();
-                       if ( !$this->listoutput )
+                       if ( !$this->listoutput ) {
                                $html[] = $this->openList( $offset );
+                       }
 
                        # $res might contain the whole 1,000 rows, so we read up to
                        # $num [should update this to use a Pager]
@@ -583,8 +584,9 @@ abstract class QueryPage extends SpecialPage {
                                }
                        }
 
-                       if ( !$this->listoutput )
+                       if ( !$this->listoutput ) {
                                $html[] = $this->closeList();
+                       }
 
                        $html = $this->listoutput
                                ? $wgContLang->listToText( $html )
@@ -631,7 +633,6 @@ abstract class QueryPage extends SpecialPage {
                                $this->feedUrl() );
                        $feed->outHeader();
 
-                       $dbr = wfGetDB( DB_SLAVE );
                        $res = $this->reallyDoQuery( $limit, 0 );
                        foreach ( $res as $obj ) {
                                $item = $this->feedResult( $obj );