59 private const IS_DELETED = 1;
60 private const CANNOT_VIEW = 2;
62 private const LIMIT_PARSE = 1;
103 private $numUncachedDiffs = 0;
148 parent::__construct( $queryModule, $moduleName, $paramPrefix );
151 $services = MediaWikiServices::getInstance();
152 $this->revisionStore = $revisionStore ?? $services->getRevisionStore();
153 $this->contentHandlerFactory = $contentHandlerFactory ?? $services->getContentHandlerFactory();
154 $this->parserFactory = $parserFactory ?? $services->getParserFactory();
155 $this->slotRoleRegistry = $slotRoleRegistry ?? $services->getSlotRoleRegistry();
156 $this->contentRenderer = $contentRenderer ?? $services->getContentRenderer();
157 $this->contentTransformer = $contentTransformer ?? $services->getContentTransformer();
158 $this->commentFormatter = $commentFormatter ?? $services->getCommentFormatter();
159 $this->tempUserCreator = $tempUserCreator ?? $services->getTempUserCreator();
160 $this->userFactory = $userFactory ?? $services->getUserFactory();
161 $this->userNameUtils = $userNameUtils ?? $services->getUserNameUtils();
169 $this->
run( $resultPageSet );
184 $prop = array_fill_keys(
$params[
'prop'],
true );
186 $this->fld_ids = isset( $prop[
'ids'] );
187 $this->fld_flags = isset( $prop[
'flags'] );
188 $this->fld_timestamp = isset( $prop[
'timestamp'] );
189 $this->fld_comment = isset( $prop[
'comment'] );
190 $this->fld_parsedcomment = isset( $prop[
'parsedcomment'] );
191 $this->fld_size = isset( $prop[
'size'] );
192 $this->fld_slotsize = isset( $prop[
'slotsize'] );
193 $this->fld_sha1 = isset( $prop[
'sha1'] );
194 $this->fld_slotsha1 = isset( $prop[
'slotsha1'] );
195 $this->fld_content = isset( $prop[
'content'] );
196 $this->fld_contentmodel = isset( $prop[
'contentmodel'] );
197 $this->fld_userid = isset( $prop[
'userid'] );
198 $this->fld_user = isset( $prop[
'user'] );
199 $this->fld_tags = isset( $prop[
'tags'] );
200 $this->fld_roles = isset( $prop[
'roles'] );
201 $this->fld_parsetree = isset( $prop[
'parsetree'] );
203 $this->slotRoles =
$params[
'slots'];
205 if ( $this->slotRoles !==
null ) {
206 if ( $this->fld_parsetree ) {
208 'apierror-invalidparammix-cannotusewith',
211 ],
'invalidparammix' );
214 'expandtemplates',
'generatexml',
'parse',
'diffto',
'difftotext',
'difftotextpst',
219 'apierror-invalidparammix-cannotusewith',
222 ],
'invalidparammix' );
225 $this->slotContentFormats = [];
226 foreach ( $this->slotRoles as $slotRole ) {
227 if ( isset(
$params[
'contentformat-' . $slotRole] ) ) {
228 $this->slotContentFormats[$slotRole] =
$params[
'contentformat-' . $slotRole];
233 if ( !empty(
$params[
'contentformat'] ) ) {
234 $this->contentFormat =
$params[
'contentformat'];
237 $this->limit =
$params[
'limit'];
239 if (
$params[
'difftotext'] !==
null ) {
240 $this->difftotext =
$params[
'difftotext'];
241 $this->difftotextpst =
$params[
'difftotextpst'];
242 } elseif (
$params[
'diffto'] !==
null ) {
243 if (
$params[
'diffto'] ==
'cur' ) {
246 if ( ( !ctype_digit(
$params[
'diffto'] ) ||
$params[
'diffto'] < 0 )
250 $this->
dieWithError( [
'apierror-baddiffto', $p ],
'diffto' );
255 if ( is_numeric(
$params[
'diffto'] ) &&
$params[
'diffto'] != 0 ) {
256 $difftoRev = $this->revisionStore->getRevisionById(
$params[
'diffto'] );
261 $revDel = $this->checkRevDel( $difftoRev, RevisionRecord::DELETED_TEXT );
262 if ( $revDel & self::CANNOT_VIEW ) {
263 $this->
addWarning( [
'apiwarn-difftohidden', $difftoRev->getId() ] );
267 $this->diffto =
$params[
'diffto'];
270 $this->fetchContent = $this->fld_content || $this->diffto !==
null
274 if ( $this->fetchContent ) {
276 $this->expandTemplates =
$params[
'expandtemplates'];
277 $this->generateXML =
$params[
'generatexml'];
278 $this->parseContent =
$params[
'parse'];
279 if ( $this->parseContent ) {
281 $this->limit ??= self::LIMIT_PARSE;
283 $this->section =
$params[
'section'] ??
false;
286 $userMax = $this->parseContent ? self::LIMIT_PARSE :
288 $botMax = $this->parseContent ? self::LIMIT_PARSE :
290 if ( $this->limit ==
'max' ) {
291 $this->limit = $this->
getMain()->canApiHighLimits() ? $botMax : $userMax;
292 if ( $this->setParsedLimit ) {
297 $this->limit = $this->
getMain()->getParamValidator()->validateValue(
298 $this,
'limit', $this->limit ?? 10, [
299 ParamValidator::PARAM_TYPE =>
'limit',
300 IntegerDef::PARAM_MIN => 1,
301 IntegerDef::PARAM_MAX => $userMax,
302 IntegerDef::PARAM_MAX2 => $botMax,
303 IntegerDef::PARAM_IGNORE_RANGE =>
true,
307 $this->needSlots = $this->fetchContent || $this->fld_contentmodel ||
309 if ( $this->needSlots && $this->slotRoles ===
null ) {
313 $parentParam = $parent->encodeParamName( $parent->getModuleManager()->getModuleGroup( $name ) );
315 [
'apiwarn-deprecation-missingparam', $encParam ],
316 "action=query&{$parentParam}={$name}&!{$encParam}"
328 private function checkRevDel(
RevisionRecord $revision, $field ) {
329 $ret = $revision->
isDeleted( $field ) ? self::IS_DELETED : 0;
332 $ret |= ( $canSee ? 0 : self::CANNOT_VIEW );
349 if ( $this->fld_ids ) {
350 $vals[
'revid'] = (int)$revision->
getId();
356 if ( $this->fld_flags ) {
357 $vals[
'minor'] = $revision->
isMinor();
360 if ( $this->fld_user || $this->fld_userid ) {
361 $revDel = $this->checkRevDel( $revision, RevisionRecord::DELETED_USER );
362 if ( $revDel & self::IS_DELETED ) {
363 $vals[
'userhidden'] =
true;
366 if ( !( $revDel & self::CANNOT_VIEW ) ) {
367 $u = $revision->
getUser( RevisionRecord::RAW );
368 if ( $this->fld_user ) {
369 $vals[
'user'] = $u->getName();
371 if ( $this->userNameUtils->isTemp( $u->getName() ) ) {
372 $vals[
'temp'] =
true;
374 if ( !$u->isRegistered() ) {
375 $vals[
'anon'] =
true;
378 if ( $this->fld_userid ) {
379 $vals[
'userid'] = $u->getId();
384 if ( $this->fld_timestamp ) {
388 if ( $this->fld_size ) {
390 $vals[
'size'] = (int)$revision->
getSize();
398 if ( $this->fld_sha1 ) {
399 $revDel = $this->checkRevDel( $revision, RevisionRecord::DELETED_TEXT );
400 if ( $revDel & self::IS_DELETED ) {
401 $vals[
'sha1hidden'] =
true;
404 if ( !( $revDel & self::CANNOT_VIEW ) ) {
406 $vals[
'sha1'] = Wikimedia\base_convert( $revision->
getSha1(), 36, 16, 40 );
416 if ( $this->fld_roles ) {
420 if ( $this->needSlots ) {
421 $revDel = $this->checkRevDel( $revision, RevisionRecord::DELETED_TEXT );
422 if ( ( $this->fld_slotsha1 || $this->fetchContent ) && ( $revDel & self::IS_DELETED ) ) {
425 $vals = array_merge( $vals, $this->extractAllSlotInfo( $revision, $revDel ) );
430 $vals[
'slotsmissing'] =
true;
432 LoggerFactory::getInstance(
'api-warning' )->error(
433 'Failed to access revision slots',
434 [
'revision' => $revision->
getId(),
'exception' => $ex, ]
438 if ( $this->fld_comment || $this->fld_parsedcomment ) {
439 $revDel = $this->checkRevDel( $revision, RevisionRecord::DELETED_COMMENT );
440 if ( $revDel & self::IS_DELETED ) {
441 $vals[
'commenthidden'] =
true;
444 if ( !( $revDel & self::CANNOT_VIEW ) ) {
445 $comment = $revision->
getComment( RevisionRecord::RAW );
446 $comment = $comment->text ??
'';
448 if ( $this->fld_comment ) {
449 $vals[
'comment'] = $comment;
452 if ( $this->fld_parsedcomment ) {
453 $vals[
'parsedcomment'] = $this->commentFormatter->format(
460 if ( $this->fld_tags ) {
461 if ( $row->ts_tags ) {
462 $tags = explode(
',', $row->ts_tags );
463 ApiResult::setIndexedTagName( $tags,
'tag' );
464 $vals[
'tags'] = $tags;
470 if ( $anyHidden && $revision->
isDeleted( RevisionRecord::DELETED_RESTRICTED ) ) {
471 $vals[
'suppressed'] =
true;
486 private function extractAllSlotInfo(
RevisionRecord $revision, $revDel ): array {
489 if ( $this->slotRoles ===
null ) {
491 $slot = $revision->
getSlot( SlotRecord::MAIN, RevisionRecord::RAW );
495 $vals[
'textmissing'] =
true;
501 $vals += $this->extractSlotInfo( $slot, $revDel, $content );
502 if ( !empty( $vals[
'nosuchsection'] ) ) {
505 'apierror-nosuchsection-what',
507 $this->
msg(
'revid', $revision->
getId() )
513 $vals += $this->extractDeprecatedContent( $content, $revision );
517 $roles = array_intersect( $this->slotRoles, $revision->
getSlotRoles() );
521 foreach ( $roles as $role ) {
523 $slot = $revision->
getSlot( $role, RevisionRecord::RAW );
527 $vals[
'slots'][$role][
'missing'] =
true;
531 $vals[
'slots'][$role] = $this->extractSlotInfo( $slot, $revDel, $content );
540 'apierror-badformat',
543 $this->
msg(
'revid', $revision->
getId() )
545 $vals[
'slots'][$role][
'badcontentformat'] =
true;
547 $vals[
'slots'][$role][
'contentmodel'] = $model;
548 $vals[
'slots'][$role][
'contentformat'] = $format;
550 $vals[
'slots'][$role],
572 private function extractSlotInfo(
SlotRecord $slot, $revDel, &$content =
null ) {
576 if ( $this->fld_slotsize ) {
577 $vals[
'size'] = (int)$slot->
getSize();
580 if ( $this->fld_slotsha1 ) {
581 if ( $revDel & self::IS_DELETED ) {
582 $vals[
'sha1hidden'] =
true;
584 if ( !( $revDel & self::CANNOT_VIEW ) ) {
585 if ( $slot->
getSha1() !=
'' ) {
586 $vals[
'sha1'] = Wikimedia\base_convert( $slot->
getSha1(), 36, 16, 40 );
593 if ( $this->fld_contentmodel ) {
594 $vals[
'contentmodel'] = $slot->
getModel();
598 if ( $this->fetchContent ) {
599 if ( $revDel & self::IS_DELETED ) {
600 $vals[
'texthidden'] =
true;
602 if ( !( $revDel & self::CANNOT_VIEW ) ) {
607 $vals[
'textmissing'] =
true;
612 if ( $content && $this->section !==
false ) {
613 $content = $content->
getSection( $this->section );
615 $vals[
'nosuchsection'] =
true;
634 if ( $this->fld_parsetree || ( $this->fld_content && $this->generateXML ) ) {
637 '@phan-var WikitextContent $content';
638 $t = $content->getText(); # note: don
't set $text
640 $parser = $this->parserFactory->create();
641 $parser->startExternalParse(
643 ParserOptions::newFromContext( $this->getContext() ),
644 Parser::OT_PREPROCESS
646 $dom = $parser->preprocessToDom( $t );
647 // @phan-suppress-next-line PhanUndeclaredMethodInCallable
648 if ( is_callable( [ $dom, 'saveXML
' ] ) ) {
649 // @phan-suppress-next-line PhanUndeclaredMethod
650 $xml = $dom->saveXML();
652 // @phan-suppress-next-line PhanUndeclaredMethod
653 $xml = $dom->__toString();
655 $vals['parsetree
'] = $xml;
657 $vals['badcontentformatforparsetree
'] = true;
660 'apierror-parsetree-notwikitext-title
',
661 wfEscapeWikiText( $title->getPrefixedText() ),
664 'parsetree-notwikitext
'
669 if ( $this->fld_content ) {
672 if ( $this->expandTemplates && !$this->parseContent ) {
673 if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) {
676 $text = $content->getText();
678 $text = $this->parserFactory->create()->preprocess(
681 ParserOptions::newFromContext( $this->getContext() )
685 'apierror-templateexpansion-notwikitext
',
686 wfEscapeWikiText( $title->getPrefixedText() ),
689 $vals['badcontentformat
'] = true;
693 if ( $this->parseContent ) {
694 $po = $this->contentRenderer->getParserOutput(
698 ParserOptions::newFromContext( $this->getContext() )
700 $text = $po->getText();
703 if ( $text === null ) {
704 $format = $this->contentFormat ?: $content->getDefaultFormat();
705 $model = $content->getModel();
707 if ( !$content->isSupportedFormat( $format ) ) {
708 $name = wfEscapeWikiText( $title->getPrefixedText() );
709 $this->addWarning( [ 'apierror-badformat
', $this->contentFormat, $model, $name ] );
710 $vals['badcontentformat
'] = true;
713 $text = $content->serialize( $format );
714 // always include format and model.
715 // Format is needed to deserialize, model is needed to interpret.
716 $vals['contentformat
'] = $format;
717 $vals['contentmodel
'] = $model;
721 if ( $text !== false ) {
722 ApiResult::setContentValue( $vals, 'content
', $text );
726 if ( $content && ( $this->diffto !== null || $this->difftotext !== null ) ) {
727 if ( $this->numUncachedDiffs < $this->getConfig()->get( MainConfigNames::APIMaxUncachedDiffs ) ) {
729 $context = new DerivativeContext( $this->getContext() );
730 $context->setTitle( $title );
731 $handler = $content->getContentHandler();
733 if ( $this->difftotext !== null ) {
734 $model = $title->getContentModel();
736 if ( $this->contentFormat
737 && !$this->contentHandlerFactory->getContentHandler( $model )
738 ->isSupportedFormat( $this->contentFormat )
740 $name = wfEscapeWikiText( $title->getPrefixedText() );
741 $this->addWarning( [ 'apierror-badformat
', $this->contentFormat, $model, $name ] );
742 $vals['diff
']['badcontentformat
'] = true;
745 $difftocontent = $this->contentHandlerFactory->getContentHandler( $model )
746 ->unserializeContent( $this->difftotext, $this->contentFormat );
748 if ( $this->difftotextpst ) {
749 $popts = ParserOptions::newFromContext( $this->getContext() );
750 $difftocontent = $this->contentTransformer->preSaveTransform(
753 $this->getUserForPreview(),
758 $engine = $handler->createDifferenceEngine( $context );
759 $engine->setContent( $content, $difftocontent );
762 $engine = $handler->createDifferenceEngine( $context, $revision->getId(), $this->diffto );
763 $vals['diff
']['from
'] = $engine->getOldid();
764 $vals['diff
']['to
'] = $engine->getNewid();
767 $difftext = $engine->getDiffBody();
768 ApiResult::setContentValue( $vals['diff
'], 'body
', $difftext );
769 if ( !$engine->wasCacheHit() ) {
770 $this->numUncachedDiffs++;
772 foreach ( $engine->getRevisionLoadErrors() as $msg ) {
773 $this->addWarning( $msg );
777 $vals['diff
']['notcached
'] = true;
784 private function getUserForPreview() {
785 $user = $this->getUser();
786 if ( $this->tempUserCreator->shouldAutoCreate( $user, 'edit
' ) ) {
787 return $this->userFactory->newUnsavedTempUser(
788 $this->tempUserCreator->getStashedName( $this->getRequest()->getSession() )
800 public function getCacheMode( $params ) {
801 if ( $this->userCanSeeRevDel() ) {
812 public function getAllowedParams() {
813 $slotRoles = $this->slotRoleRegistry->getKnownRoles();
814 sort( $slotRoles, SORT_STRING );
815 $smallLimit = $this->getMain()->canApiHighLimits() ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_SML1;
819 ParamValidator::PARAM_ISMULTI => true,
820 ParamValidator::PARAM_DEFAULT => 'ids|timestamp|flags|comment|user
',
821 ParamValidator::PARAM_TYPE => [
839 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-prop
',
840 ApiBase::PARAM_HELP_MSG_PER_VALUE => [
841 'ids
' => 'apihelp-query+revisions+base-paramvalue-prop-ids
',
842 'flags
' => 'apihelp-query+revisions+base-paramvalue-prop-flags
',
843 'timestamp
' => 'apihelp-query+revisions+base-paramvalue-prop-timestamp
',
844 'user
' => 'apihelp-query+revisions+base-paramvalue-prop-user
',
845 'userid
' => 'apihelp-query+revisions+base-paramvalue-prop-userid
',
846 'size
' => 'apihelp-query+revisions+base-paramvalue-prop-size
',
847 'slotsize
' => 'apihelp-query+revisions+base-paramvalue-prop-slotsize
',
848 'sha1
' => 'apihelp-query+revisions+base-paramvalue-prop-sha1
',
849 'slotsha1
' => 'apihelp-query+revisions+base-paramvalue-prop-slotsha1
',
850 'contentmodel
' => 'apihelp-query+revisions+base-paramvalue-prop-contentmodel
',
851 'comment
' => 'apihelp-query+revisions+base-paramvalue-prop-comment
',
852 'parsedcomment
' => 'apihelp-query+revisions+base-paramvalue-prop-parsedcomment
',
853 'content
' => [ 'apihelp-query+revisions+base-paramvalue-prop-content
', $smallLimit ],
854 'tags
' => 'apihelp-query+revisions+base-paramvalue-prop-tags
',
855 'roles
' => 'apihelp-query+revisions+base-paramvalue-prop-roles
',
856 'parsetree
' => [ 'apihelp-query+revisions+base-paramvalue-prop-parsetree
',
857 CONTENT_MODEL_WIKITEXT, $smallLimit ],
859 EnumDef::PARAM_DEPRECATED_VALUES => [
864 ParamValidator::PARAM_TYPE => $slotRoles,
865 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-slots
',
866 ParamValidator::PARAM_ISMULTI => true,
867 ParamValidator::PARAM_ALL => true,
869 'contentformat-{slot}
' => [
870 ApiBase::PARAM_TEMPLATE_VARS => [ 'slot
' => 'slots
' ],
871 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-contentformat-slot
',
872 ParamValidator::PARAM_TYPE => $this->contentHandlerFactory->getAllContentFormats(),
875 ParamValidator::PARAM_TYPE => 'limit
',
876 IntegerDef::PARAM_MIN => 1,
877 IntegerDef::PARAM_MAX => ApiBase::LIMIT_BIG1,
878 IntegerDef::PARAM_MAX2 => ApiBase::LIMIT_BIG2,
879 ApiBase::PARAM_HELP_MSG => [ 'apihelp-query+revisions+base-param-limit
',
880 $smallLimit, self::LIMIT_PARSE ],
882 'expandtemplates
' => [
883 ParamValidator::PARAM_DEFAULT => false,
884 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-expandtemplates
',
885 ParamValidator::PARAM_DEPRECATED => true,
888 ParamValidator::PARAM_DEFAULT => false,
889 ParamValidator::PARAM_DEPRECATED => true,
890 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-generatexml
',
893 ParamValidator::PARAM_DEFAULT => false,
894 ApiBase::PARAM_HELP_MSG => [ 'apihelp-query+revisions+base-param-parse
', self::LIMIT_PARSE ],
895 ParamValidator::PARAM_DEPRECATED => true,
898 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-section
',
901 ApiBase::PARAM_HELP_MSG => [ 'apihelp-query+revisions+base-param-diffto
', $smallLimit ],
902 ParamValidator::PARAM_DEPRECATED => true,
905 ApiBase::PARAM_HELP_MSG => [ 'apihelp-query+revisions+base-param-difftotext
', $smallLimit ],
906 ParamValidator::PARAM_DEPRECATED => true,
909 ParamValidator::PARAM_DEFAULT => false,
910 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-difftotextpst
',
911 ParamValidator::PARAM_DEPRECATED => true,
914 ParamValidator::PARAM_TYPE => $this->contentHandlerFactory->getAllContentFormats(),
915 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-contentformat
',
916 ParamValidator::PARAM_DEPRECATED => true,
const CONTENT_MODEL_WIKITEXT
wfEscapeWikiText( $input)
Escapes the given text so that it may be output using addWikiText() without any linking,...
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
array $params
The job parameters.
dieWithError( $msg, $code=null, $data=null, $httpCode=0)
Abort execution with an error.
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
getMain()
Get the main module.
addDeprecation( $msg, $feature, $data=[])
Add a deprecation warning for this module.
const LIMIT_BIG1
Fast query, standard limit.
const LIMIT_SML2
Slow query, apihighlimits limit.
getResult()
Get the result object.
const LIMIT_SML1
Slow query, standard limit.
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
const LIMIT_BIG2
Fast query, apihighlimits limit.
getModuleName()
Get the name of the module being executed by this instance.
This class contains a list of pages that the client has requested.
getParent()
Get the parent of this module.to override 1.25 ApiBase|null
encodeParamName( $paramName)
Overrides ApiBase to prepend 'g' to every generator parameter.
A base class for functions common to producing a list of revisions.
$diffto
The number of uncached diffs that had to be generated for this request.
executeGenerator( $resultPageSet)
The number of uncached diffs that had to be generated for this request.
$slotContentFormats
The number of uncached diffs that had to be generated for this request.
$parseContent
The number of uncached diffs that had to be generated for this request.
$difftotext
The number of uncached diffs that had to be generated for this request.
bool $fld_ids
The number of uncached diffs that had to be generated for this request.
bool $fld_tags
The number of uncached diffs that had to be generated for this request.
bool $fld_parsetree
The number of uncached diffs that had to be generated for this request.
$generateXML
The number of uncached diffs that had to be generated for this request.
bool $fld_roles
The number of uncached diffs that had to be generated for this request.
bool $fld_content
The number of uncached diffs that had to be generated for this request.
$limit
The number of uncached diffs that had to be generated for this request.
parseParameters( $params)
Parse the parameters into the various instance fields.
$needSlots
The number of uncached diffs that had to be generated for this request.
$expandTemplates
The number of uncached diffs that had to be generated for this request.
bool $fld_sha1
The number of uncached diffs that had to be generated for this request.
bool $fld_flags
The number of uncached diffs that had to be generated for this request.
$fetchContent
The number of uncached diffs that had to be generated for this request.
bool $setParsedLimit
The number of uncached diffs that had to be generated for this request.
bool $fld_userid
The number of uncached diffs that had to be generated for this request.
bool $fld_slotsha1
The number of uncached diffs that had to be generated for this request.
array $slotRoles
The number of uncached diffs that had to be generated for this request.
execute()
The number of uncached diffs that had to be generated for this request.
bool $fld_slotsize
The number of uncached diffs that had to be generated for this request.
$section
The number of uncached diffs that had to be generated for this request.
__construct(ApiQuery $queryModule, $moduleName, $paramPrefix='', RevisionStore $revisionStore=null, IContentHandlerFactory $contentHandlerFactory=null, ParserFactory $parserFactory=null, SlotRoleRegistry $slotRoleRegistry=null, ContentRenderer $contentRenderer=null, ContentTransformer $contentTransformer=null, CommentFormatter $commentFormatter=null, TempUserCreator $tempUserCreator=null, UserFactory $userFactory=null, UserNameUtils $userNameUtils=null)
bool $fld_parsedcomment
The number of uncached diffs that had to be generated for this request.
bool $fld_timestamp
The number of uncached diffs that had to be generated for this request.
$difftotextpst
The number of uncached diffs that had to be generated for this request.
bool $fld_user
The number of uncached diffs that had to be generated for this request.
bool $fld_size
The number of uncached diffs that had to be generated for this request.
run(ApiPageSet $resultPageSet=null)
bool $fld_contentmodel
The number of uncached diffs that had to be generated for this request.
bool $fld_comment
The number of uncached diffs that had to be generated for this request.
$contentFormat
The number of uncached diffs that had to be generated for this request.
extractRevisionInfo(RevisionRecord $revision, $row)
Extract information from the RevisionRecord.
This is the main query class.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
const META_KVP_MERGE
Key for the metadata item that indicates that the KVP key should be added into an assoc value,...
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
A service to render content.
A service to transform content.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
An IContextSource implementation which will inherit context from another source but allow individual ...
A class containing constants representing the names of configuration variables.
Content object for wiki text pages.
Base interface for representing page content.
getSection( $sectionId)
Returns the section with the given ID.
getModel()
Returns the ID of the content model used by this Content object.
serialize( $format=null)
Convenience method for serializing this Content object.
getDefaultFormat()
Convenience method that returns the default serialization format for the content model that this Cont...
isSupportedFormat( $format)
Returns true if $format is a supported serialization format for this Content object,...