86 $seg = explode(
'|', $segment, 2 );
87 if ( count( $seg ) > 1 ) {
88 if ( $seg[0] ===
'after' ) {
91 } elseif ( $seg[0] ==
'before' ) {
102 'offset' => $segment,
121 string $segment =
'',
127 $paramArr = $this->getPagerParams( $limit, $segment );
128 $context->setRequest(
new FauxRequest( $paramArr ) );
131 $pager = $this->getContribsPager( $context, $target, [
133 'revisionsOnly' =>
true
138 if ( $pager->getNumRows() > 0 ) {
139 foreach ( $pager->mResult as $row ) {
141 if ( ++$count > $limit ) {
146 $revision = $this->revisionStore->newRevisionFromRow( $row, 0 );
147 $revisions[] = $revision;
148 if ( $row->ts_tags ) {
149 $tagNames = explode(
',', $row->ts_tags );
150 $tags[ $row->rev_id ] = $this->getContributionTags( $tagNames );
155 $deltas = $this->getContributionDeltas( $revisions );
158 'newest' => $pager->mIsFirst,
159 'oldest' => $pager->mIsLast,
163 $pager->mIsFirst =
false;
164 $pagingQueries = $pager->getPagingQueries();
166 $prev = $pagingQueries[
'prev'][
'offset'] ??
null;
167 $next = $pagingQueries[
'next'][
'offset'] ??
null;
169 $after = $prev ?
'after|' . $prev :
null;
170 $before = $next ?
'before|' . $next :
null;
174 if ( $paramArr[
'dir'] ===
'prev' ) {
175 $revisions = array_reverse( $revisions );
177 return new ContributionsSegment( $revisions, $tags, $before, $after, $deltas, $flags );
186 foreach ( $tagNames as $name ) {
189 $tagMetadata[$name] = $tagDisplay;
207 foreach ( $revisions as $revision ) {
208 $revId = $revision->getId();
209 $parentIds[$revId] = $revision->getParentId();
211 $parentSizes = $this->revisionStore->getRevisionSizes( $parentIds );
213 foreach ( $revisions as $revision ) {
214 $parentId = $revision->getParentId();
215 if ( $parentId === 0 ) {
216 $delta = $revision->getSize();
217 } elseif ( !isset( $parentSizes[$parentId] ) ) {
220 $delta = $revision->getSize() - $parentSizes[$parentId];
222 $deltas[ $revision->getId() ] = $delta;
242 $pager = $this->getContribsPager( $context, $user, [
246 $query = $pager->getQueryInfo();
248 $count = $pager->mDb->selectField(
268 $this->linkRendererFactory->create(),
269 $this->linkBatchFactory,
270 $this->hookContainer,
272 $this->actorMigration,
273 $this->revisionStore,
274 $this->namespaceInfo,
This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed once acto...
WebRequest clone which takes values from a provided array.
The Message class deals with fetching and processing of interface message into a variety of formats.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Group all the pieces relevant to the context of a request into one instance @newable.
setAuthority(Authority $authority)
Interface for objects which can provide a MediaWiki context on request.