21use Psr\Log\LoggerInterface;
22use Wikimedia\ObjectFactory\ObjectFactory;
33 private LoggerInterface $logger;
34 private ObjectFactory $objectFactory;
40 private const CORE_LIST = [
42 'class' => ExtractBody::class,
46 'optional_services' => [
47 'MobileFrontend.Context',
50 'AddRedirectHeader' => [
51 'class' => AddRedirectHeader::class,
53 'RenderDebugInfo' => [
54 'class' => RenderDebugInfo::class,
59 'ParsoidLocalization' => [
60 'class' => ParsoidLocalization::class,
62 'ExecutePostCacheTransformHooks' => [
63 'class' => ExecutePostCacheTransformHooks::class,
68 'AddWrapperDivClass' => [
69 'class' => AddWrapperDivClass::class,
75 'HandleSectionLinks' => [
76 'class' => HandleSectionLinks::class,
81 'HandleParsoidSectionLinks' => [
82 'class' => HandleParsoidSectionLinks::class,
87 'HandleTOCMarkers' => [
88 'class' => HandleTOCMarkers::class,
93 'DeduplicateStyles' => [
94 'class' => DeduplicateStyles::class,
96 'ExpandToAbsoluteUrls' => [
97 'class' => ExpandToAbsoluteUrls::class,
99 'HydrateHeaderPlaceholders' => [
100 'class' => HydrateHeaderPlaceholders::class,
102 # This should be last, in order to ensure final output is hardened
104 'class' => HardenNFC::class,
111 LoggerInterface $logger,
112 ObjectFactory $objectFactory
115 $this->options = $options;
116 $this->config = $config;
117 $this->logger = $logger;
118 $this->objectFactory = $objectFactory;
135 foreach ( $list as $spec ) {
136 $class = $spec[
'class'];
138 $class::CONSTRUCTOR_OPTIONS, $this->config
140 $transform = $this->objectFactory->createObject(
143 'assertClass' => OutputTransformStage::class,
144 'extraArgs' => [ $svcOptions, $this->logger ],
147 $otp->addStage( $transform );
A class containing constants representing the names of configuration variables.
const OutputPipelineStages
Name constant for the OutputPipelineStages setting, for use with Config::get()
Applies base href, and strip everything but the <body>