Handle client disconnects in scoped timeout blocks.
[lhc/web/wiklou.git] / includes / Pager.php
index 9d1f9fc..bcd6d14 100644 (file)
@@ -194,7 +194,6 @@ abstract class IndexPager extends ContextSource implements Pager {
                        $queryLimit,
                        $descending
                );
-
                $this->extractResultInfo( $this->mOffset, $queryLimit, $this->mResult );
                $this->mQueryDone = true;
 
@@ -304,21 +303,7 @@ abstract class IndexPager extends ContextSource implements Pager {
         * @param $descending Boolean: query direction, false for ascending, true for descending
         * @return ResultWrapper
         */
-       public function reallyDoQuery( $offset, $limit, $descending ) {
-               list( $tables, $fields, $conds, $fname, $options, $join_conds ) = $this->buildQueryInfo( $offset, $limit, $descending );
-               $result = $this->mDb->select( $tables, $fields, $conds, $fname, $options, $join_conds );
-               return new ResultWrapper( $this->mDb, $result );
-       }
-
-       /**
-        * Build variables to use by the database wrapper.
-        *
-        * @param $offset String: index offset, inclusive
-        * @param $limit Integer: exact query limit
-        * @param $descending Boolean: query direction, false for ascending, true for descending
-        * @return array
-        */
-       protected function buildQueryInfo( $offset, $limit, $descending ) {
+       function reallyDoQuery( $offset, $limit, $descending ) {
                $fname = __METHOD__ . ' (' . $this->getSqlComment() . ')';
                $info = $this->getQueryInfo();
                $tables = $info['tables'];
@@ -342,7 +327,8 @@ abstract class IndexPager extends ContextSource implements Pager {
                        $conds[] = $this->mIndexField . $operator . $this->mDb->addQuotes( $offset );
                }
                $options['LIMIT'] = intval( $limit );
-               return array( $tables, $fields, $conds, $fname, $options, $join_conds );
+               $res = $this->mDb->select( $tables, $fields, $conds, $fname, $options, $join_conds );
+               return new ResultWrapper( $this->mDb, $res );
        }
 
        /**