Move some providers in new MediaWikiProvide class
[lhc/web/wiklou.git] / includes / QueryPage.php
index a45311f..9078e63 100644 (file)
@@ -135,9 +135,9 @@ abstract class QueryPage extends SpecialPage {
         * For back-compat, subclasses may return a raw SQL query here, as a string.
         * This is stronly deprecated; getQueryInfo() should be overridden instead.
         * @return string
-        * @deprecated since 1.18
         */
        function getSQL() {
+               /* Implement getQueryInfo() instead */
                throw new MWException( "Bug in a QueryPage: doesn't implement getQueryInfo() nor getQuery() properly" );
        }
 
@@ -407,6 +407,11 @@ abstract class QueryPage extends SpecialPage {
                if ( $offset !== false ) {
                        $options['OFFSET'] = intval( $offset );
                }
+               if ( $this->sortDescending() ) {
+                       $options['ORDER BY'] = 'qc_value DESC';
+               } else {
+                       $options['ORDER BY'] = 'qc_value ASC';
+               }
                $res = $dbr->select( 'querycache', array( 'qc_type',
                                'qc_namespace AS namespace',
                                'qc_title AS title',
@@ -416,7 +421,7 @@ abstract class QueryPage extends SpecialPage {
                );
                return $dbr->resultObject( $res );
        }
-       
+
        public function getCachedTimestamp() {
                if ( !is_null( $this->cachedTimestamp ) ) {
                        $dbr = wfGetDB( DB_SLAVE );