Roan Kattouw schreef:
prop=imageinfo looks somewhat tricky. I might change "continue" to be the concatenation of the image title and the appropriate start value, and change the logic something like this: $titles = array_keys( $pageIds[NS_FILE] ); sort($titles); // Unless we can depend on the order to always be the same
Actually, I believe these things are ordered by page IDs somewhere in ApiPageSet, so the order would be the same every time except when a file is moved/renamed.
$images = RepoGroup::singleton()->findFiles( $titles ); if(is_null($params['continue'])){ $skip = false; } else { $skip = true; list($continue_title, $continue_start) = explode('|', $params['continue']); } foreach ( $titles as $title ) { $start = $params['start']; if($skip) { if($title != $continue_title) continue; $skip = false; $start = $continue_start; }
if(!isset($images[$title])) { // Add the "missing" record, as in lines 143-148 of r47043 // except add a break in the !$fit case continue; } $img = $images[$title]; // Add the "not missing" record, as in lines 68-134 of r47043 // except use $start instead of $params['start']
}
Looks sane, I'll probably do this tomorrow.
Implemented something similar to your suggestion in r47108.
prop=info could be done by merging $titles and $missing (if necessary), doing an asort, and using similar logic. The continue would be just the title.
I'll look into that tomorrow as well.
On second thought, I don't think we need it: prop=info doesn't have the issues other modules have, because it doesn't return multiple entries per page. Just throwing in an asort() (which I'll do tomorrow) should suffice.
For prop=revisions, I wonder if MySQL would filesort if you order by rev_id/page_id (depending on which is being used in the WHERE clause), since I would guess that's the index being used to fetch the rows anyway. If not, that could easily work for the continue parameter in non-enum mode (enum mode is already OK).
Apart from non-enum mode, there are two other modes. In titles= mode, the query fetches rows using the PRIMARY (rev_page, rev_id) index, which can be paged by rev_page (equal to page_id) just fine. In revids= mode, it uses the rev_id (rev_id) index, which we can be on as well. All in all, this should be an easy one; I'll look into it tomorrow as well.
Did this as well in r47078.
Roan Kattouw (Catrope)