From: Aaron Schulz Date: Sun, 20 May 2012 18:15:42 +0000 (+0000) Subject: Merge "multi dbms support in api" X-Git-Tag: 1.31.0-rc.0~23559 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22sites_tous%22%29%20.%20%22?a=commitdiff_plain;h=fdb74872a83a4f95aa6e51e18c8f415fbbf98ff0;p=lhc%2Fweb%2Fwiklou.git Merge "multi dbms support in api" --- fdb74872a83a4f95aa6e51e18c8f415fbbf98ff0 diff --cc includes/api/ApiBlock.php index 9a2f25565c,d7f121fbfc..e229ef01c3 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@@ -100,10 -100,9 +100,10 @@@ class ApiBlock extends ApiBase $block = Block::newFromTarget( $target ); if( $block instanceof Block ){ - $res['expiry'] = $block->mExpiry == wfGetDB( DB_SLAVE )->getInfinity() + $res['expiry'] = $block->mExpiry == $this->getDB()->getInfinity() ? 'infinite' : wfTimestamp( TS_ISO_8601, $block->mExpiry ); + $res['id'] = $block->getId(); } else { # should be unreachable $res['expiry'] = ''; diff --cc includes/api/ApiQueryRevisions.php index 426de6c0f3,cf41c9154c..44cb46ef24 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@@ -329,15 -322,12 +329,15 @@@ class ApiQueryRevisions extends ApiQuer $pageid = intval( $cont[0] ); $revid = intval( $cont[1] ); $this->addWhere( - "rev_page > '$pageid' OR " . - "(rev_page = '$pageid' AND " . - "rev_id >= '$revid')" + "rev_page > $pageid OR " . + "(rev_page = $pageid AND " . + "rev_id >= $revid)" ); } - $this->addOption( 'ORDER BY', 'rev_page, rev_id' ); + $this->addOption( 'ORDER BY', array( + 'rev_page', + 'rev_id' + )); // assumption testing -- we should never get more then $pageCount rows. $limit = $pageCount;