|
MediaWiki master
|
Helper class used by MediaWiki to create Parsoid PageConfig objects. More...
Inherits Wikimedia\Parsoid\Config\PageConfigFactory.

Public Member Functions | |
| __construct (private readonly RevisionStore $revisionStore, private readonly SlotRoleRegistry $slotRoleRegistry, private readonly LanguageFactory $languageFactory,) | |
| create (PageIdentity $pageId, ?UserIdentity $user=null, $revision=null, ?string $unused=null, ?Bcp47Code $pageLanguageOverride=null, bool $ensureAccessibleContent=false) | |
| Create a new PageConfig. | |
| createFromParserOptions (ParserOptions $parserOptions, PageIdentity $pageId, $revision=null, ?Bcp47Code $pageLanguageOverride=null, bool $ensureAccessibleContent=false, bool $checkAuthority=false) | |
| Create a new PageConfig. | |
Helper class used by MediaWiki to create Parsoid PageConfig objects.
Definition at line 32 of file PageConfigFactory.php.
| MediaWiki\Parser\Parsoid\Config\PageConfigFactory::__construct | ( | private readonly RevisionStore | $revisionStore, |
| private readonly SlotRoleRegistry | $slotRoleRegistry, | ||
| private readonly LanguageFactory | $languageFactory ) |
Definition at line 33 of file PageConfigFactory.php.
| MediaWiki\Parser\Parsoid\Config\PageConfigFactory::create | ( | PageIdentity | $pageId, |
| ?UserIdentity | $user = null, | ||
| $revision = null, | |||
| ?string | $unused = null, | ||
| ?Bcp47Code | $pageLanguageOverride = null, | ||
| bool | $ensureAccessibleContent = false ) |
Create a new PageConfig.
Note that Parsoid isn't supposed to use the user context by design; all user-specific processing is expected to be introduced as a post-parse transform. The $user parameter is therefore usually null, especially in background job parsing, although there are corner cases during extension processing where a non-null $user could affect the output.
| PageIdentity | $pageId | The page represented by the PageConfig. |
| ?UserIdentity | $user | User who is doing rendering (for parsing options). |
| int | RevisionRecord | null | $revision | Revision id or a revision record |
| ?string | $unused | |
| ?Bcp47Code | $pageLanguageOverride | |
| bool | $ensureAccessibleContent | If true, ensures that we can get content from the newly constructed pageConfig's RevisionRecord and throws a RevisionAccessException if not. |
| RevisionAccessException |
Definition at line 61 of file PageConfigFactory.php.
References wfDeprecated().
| MediaWiki\Parser\Parsoid\Config\PageConfigFactory::createFromParserOptions | ( | ParserOptions | $parserOptions, |
| PageIdentity | $pageId, | ||
| $revision = null, | |||
| ?Bcp47Code | $pageLanguageOverride = null, | ||
| bool | $ensureAccessibleContent = false, | ||
| bool | $checkAuthority = false ) |
Create a new PageConfig.
Note that Parsoid isn't supposed to use the user context by design; all user-specific processing is expected to be introduced as a post-parse transform. The $user parameter is therefore usually null, especially in background job parsing, although there are corner cases during extension processing where a non-null $user could affect the output.
The page language comes from the ParserOptions, as in Parser::getTargetLanguage(): the target language if it is set, else the user language for an interface message, else the page language of the title. To override the page language, set the target language in the ParserOptions before you call this method. This method does not change the ParserOptions.
| ParserOptions | $parserOptions | (See note above about user identity in the parser options.) Set the 'useParsoid' option. Since 1.47, a call without 'useParsoid' set is deprecated. |
| PageIdentity | $pageId | The page represented by the PageConfig. |
| int | RevisionRecord | null | $revision | Revision id or a revision record |
| ?Bcp47Code | $pageLanguageOverride | Deprecated since 1.47; set the target language in $parserOptions instead. |
| bool | $ensureAccessibleContent | If true, ensures that we can get content from the newly constructed pageConfig's RevisionRecord and throws a RevisionAccessException if not. |
| bool | $checkAuthority |
| RevisionAccessException |
Definition at line 121 of file PageConfigFactory.php.