* The prototype for a token function is func($pageid, $title, $rc)
* it should return a token or false (permission denied)
* @deprecated since 1.24
- * @return array Array(tokenname => function)
+ * @return array [ tokenname => function ]
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
* AND rc_timestamp < $end AND rc_namespace = $namespace
*/
$this->addTables( 'recentchanges' );
- $index = [ 'recentchanges' => 'rc_timestamp' ]; // May change
$this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
if ( !is_null( $params['continue'] ) ) {
if ( !is_null( $params['user'] ) ) {
$this->addWhereFld( 'rc_user_text', $params['user'] );
- $index['recentchanges'] = 'rc_user_text';
}
if ( !is_null( $params['excludeuser'] ) ) {
$this->token = $params['token'];
$this->addOption( 'LIMIT', $params['limit'] + 1 );
- $this->addOption( 'USE INDEX', $index );
$count = 0;
/* Perform the actual query. */
/* Iterate through the rows, adding data extracted from them to our query result. */
foreach ( $res as $row ) {
+ if ( $count === 0 && $resultPageSet !== null ) {
+ // Set the non-continue since the list of recentchanges is
+ // prone to having entries added at the start frequently.
+ $this->getContinuationManager()->addGeneratorNonContinueParam(
+ $this, 'continue', "$row->rc_timestamp|$row->rc_id"
+ );
+ }
if ( ++$count > $params['limit'] ) {
// We've reached the one extra which shows that there are
// additional pages to be had. Stop here...