From: Yuri Astrakhan Date: Fri, 3 Nov 2006 04:56:42 +0000 (+0000) Subject: API * forcing the rc_timestamp index (to safeguard myself any harm from domas) X-Git-Tag: 1.31.0-rc.0~55308 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=31d366d44797ab5d52f6f085e923a8cd9f1f4ad1;p=lhc%2Fweb%2Fwiklou.git API * forcing the rc_timestamp index (to safeguard myself any harm from domas) --- diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 6ed0d4bb19..e086b50a66 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -45,8 +45,8 @@ class ApiQueryRecentChanges extends ApiQueryBase { if (!is_null($hide)) { $hide = array_flip($hide); - if(isset ($hide['anons']) && isset ($hide['liu'])) - $this->dieUsage( "Both 'anons' and 'liu' cannot be set at the same time", 'hide' ); + if (isset ($hide['anons']) && isset ($hide['liu'])) + $this->dieUsage("Both 'anons' and 'liu' cannot be set at the same time", 'hide'); $this->addWhereIf('rc_minor = 0', isset ($hide['minor'])); $this->addWhereIf('rc_bot = 0', isset ($hide['bots'])); $this->addWhereIf('rc_user != 0', isset ($hide['anons'])); @@ -80,6 +80,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { } $this->addOption('LIMIT', $limit +1); + $this->addOption('USE INDEX', 'rc_timestamp'); $data = array (); $count = 0; @@ -93,7 +94,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { } $vals = $this->addRowInfo('rc', $row); - if($vals) + if ($vals) $data[] = $vals; } $db->freeResult($res); @@ -164,7 +165,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { protected function getExamples() { return array ( - 'api.php?action=query&list=recentchanges', + 'api.php?action=query&list=recentchanges' ); }