options = $options; $this->revisionLookup = $revisionLookup; $this->revisionRenderer = $revisionRenderer; $this->titleFormatter = $titleFormatter; $this->pageLookup = $pageLookup; $this->parsoidOutputStash = $parsoidOutputStash; $this->stats = $statsDataFactory; $this->parserOutputAccess = $parserOutputAccess; $this->parsoidSiteConfig = $parsoidSiteConfig; $this->htmlTransformFactory = $htmlTransformFactory; $this->contentHandlerFactory = $contentHandlerFactory; $this->languageFactory = $languageFactory; $this->redirectStore = $redirectStore; $this->languageConverterFactory = $languageConverterFactory; $this->statsFactory = $statsFactory; $this->titleFactory = $titleFactory; $this->connectionProvider = $connectionProvider; $this->changeTagStore = $changeTagStore; } public function newRevisionContentHelper(): RevisionContentHelper { return new RevisionContentHelper( $this->options, $this->revisionLookup, $this->titleFormatter, $this->pageLookup, $this->titleFactory, $this->connectionProvider, $this->changeTagStore ); } public function newPageContentHelper(): PageContentHelper { return new PageContentHelper( $this->options, $this->revisionLookup, $this->titleFormatter, $this->pageLookup, $this->titleFactory, $this->connectionProvider, $this->changeTagStore ); } /** * Should we ignore page id mismatches between page and revision objects * in HTML/pagebundle requests? Mismatches arise because of page moves. * This is recommended only for handling calls to internal APIs. * @note Since 1.43, passing 'null' for $page has been deprecated. * @note Since 1.43, passing 'null' for $authority has been deprecated. * @note Since 1.43, passing $lenientRevHandling as the first parameter * has been deprecated. * @param bool|PageIdentity|null $page * If `false`, this argument is used as the value for $lenientRevHandling, * for backward-compatibility. * @param array $parameters * @param ?Authority $authority * @param int|RevisionRecord|null $revision * @param bool $lenientRevHandling */ public function newHtmlOutputRendererHelper( $page = null, array $parameters = [], ?Authority $authority = null, $revision = null, bool $lenientRevHandling = false ): HtmlOutputRendererHelper { if ( is_bool( $page ) ) { // Backward compatibility w/ pre-1.43 (deprecated) $lenientRevHandling = $page; $page = null; wfDeprecated( __METHOD__ . ' with boolean first parameter', '1.43' ); } if ( $page === null ) { wfDeprecated( __METHOD__ . ' with null $page', '1.43' ); } if ( $authority === null ) { wfDeprecated( __METHOD__ . ' with null $authority', '1.43' ); } return new HtmlOutputRendererHelper( $this->parsoidOutputStash, $this->statsFactory, $this->parserOutputAccess, $this->pageLookup, $this->revisionLookup, $this->revisionRenderer, $this->parsoidSiteConfig, $this->htmlTransformFactory, $this->contentHandlerFactory, $this->languageFactory, $page, $parameters, $authority, $revision, $lenientRevHandling ); } /** * @note Since 1.43, passing a null $page is deprecated. */ public function newHtmlMessageOutputHelper( ?PageIdentity $page = null ): HtmlMessageOutputHelper { if ( $page === null ) { wfDeprecated( __METHOD__ . ' with null $page', '1.43' ); } return new HtmlMessageOutputHelper( $page ); } public function newHtmlInputTransformHelper( $envOptions = [], ?PageIdentity $page = null, $body = null, array $parameters = [], ?RevisionRecord $originalRevision = null, ?Bcp47Code $pageLanguage = null ): HtmlInputTransformHelper { if ( $page === null || $body === null ) { wfDeprecated( __METHOD__ . ' without $page or $body' ); } return new HtmlInputTransformHelper( $this->statsFactory, $this->htmlTransformFactory, $this->parsoidOutputStash, $this->parserOutputAccess, $this->pageLookup, $this->revisionLookup, $envOptions, $page, $body ?? '', $parameters, $originalRevision, $pageLanguage ); } /** * @since 1.41 */ public function newPageRedirectHelper( ResponseFactory $responseFactory, Router $router, string $route, RequestInterface $request ): PageRedirectHelper { return new PageRedirectHelper( $this->redirectStore, $this->titleFormatter, $responseFactory, $router, $route, $request, $this->languageConverterFactory ); } }