Page MenuHomePhabricator

There's no reason to split the ParserCache on wrapclass
Open, Needs TriagePublic

Description

The 'wrapclass' option in ParserOptions is not actually used during parsing. It is just passed directly the ParserOutput::setWrapperDivClass(), and the only thing *this* is used for is to set the *default* value of the wrapperDivClass property in the $options array used by the caller of ParserOutput::getText().

We shouldn't need to split the parser cache on this.

To deprcate, we need to strip the wrapclass out of ParserOptions. Anywhere where ParserOptions::setWrapOutputClass() is set should be replaced with passing an appropriate $options array to ParserOutput::getText() instead.

Eventually we should emit hard deprecation warnings if anything ever calls ParserOutput::setWrapperDivClass(), then we can remove this entirely from the ParserOptions and ParserOutput.

Another alternative is to first remove wrapclass from the 'cache varying options' in ParserOptions, and instead transfer the wrapclass from the ParserOptions to ParserOutput after a cache fetch.

See T350626: Remove 'options' arguments to ParserOutput::getText().