mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-01 10:56:44 +00:00
1667e25854
The new locateUsersWatchingTitle implementation could end up returning thousands of users, currently on enwiki there are 25 titles with more than 10k subscribed users and aprox 550 titles with more than 1k subscribed users. This switches the user collection to an iterator based implementation so that we no longer need to have the entire users list at any one time. Change-Id: I3d3fa9328f348bb48682d3658622952ce82d3925
34 lines
597 B
PHP
34 lines
597 B
PHP
<?php
|
|
|
|
/**
|
|
* Allows extending classes to decorate an Iterator with
|
|
* reduced boilerplate.
|
|
*/
|
|
abstract class EchoIteratorDecorator implements Iterator {
|
|
protected $iterator;
|
|
|
|
public function __construct( Iterator $iterator ) {
|
|
$this->iterator = $iterator;
|
|
}
|
|
|
|
public function current() {
|
|
return $this->iterator->current();
|
|
}
|
|
|
|
public function key() {
|
|
return $this->iterator->key();
|
|
}
|
|
|
|
public function next() {
|
|
return $this->iterator->next();
|
|
}
|
|
|
|
public function rewind() {
|
|
return $this->iterator->rewind();
|
|
}
|
|
|
|
public function valid() {
|
|
return $this->iterator->valid();
|
|
}
|
|
}
|