2012-09-24 20:51:53 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* A content object represents page content, e.g. the text to show on a page.
|
|
|
|
|
* Content objects have no knowledge about how they relate to Wiki pages.
|
|
|
|
|
*
|
2012-10-16 18:04:32 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
2012-10-05 13:03:24 +00:00
|
|
|
* @since 1.21
|
2012-10-16 18:04:32 +00:00
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Content
|
|
|
|
|
*
|
|
|
|
|
* @author Daniel Kinzler
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2012-12-20 19:44:47 +00:00
|
|
|
|
2020-01-18 20:25:04 +00:00
|
|
|
use MediaWiki\Content\IContentHandlerFactory;
|
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
|
|
2012-12-20 19:44:47 +00:00
|
|
|
/**
|
|
|
|
|
* Base implementation for content objects.
|
|
|
|
|
*
|
2020-07-13 09:00:30 +00:00
|
|
|
* @stable to extend
|
2020-06-30 16:53:40 +00:00
|
|
|
*
|
2012-12-20 19:44:47 +00:00
|
|
|
* @ingroup Content
|
|
|
|
|
*/
|
2012-09-24 20:51:53 +00:00
|
|
|
abstract class AbstractContent implements Content {
|
|
|
|
|
/**
|
|
|
|
|
* Name of the content model this Content object represents.
|
|
|
|
|
* Use with CONTENT_MODEL_XXX constants
|
|
|
|
|
*
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
2019-11-29 13:33:43 +00:00
|
|
|
* @var string
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
protected $model_id;
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:53:06 +00:00
|
|
|
* @stable to call
|
2020-06-30 16:53:40 +00:00
|
|
|
*
|
2018-06-26 21:14:43 +00:00
|
|
|
* @param string|null $modelId
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.21
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2012-10-16 18:16:11 +00:00
|
|
|
public function __construct( $modelId = null ) {
|
|
|
|
|
$this->model_id = $modelId;
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::getModel
|
2017-09-09 20:47:04 +00:00
|
|
|
* @return string
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getModel() {
|
|
|
|
|
return $this->model_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
|
|
|
|
* @param string $modelId The model to check
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @throws MWException If the provided ID is not the ID of the content model supported by this
|
|
|
|
|
* Content object.
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2012-10-16 18:16:11 +00:00
|
|
|
protected function checkModelID( $modelId ) {
|
|
|
|
|
if ( $modelId !== $this->model_id ) {
|
|
|
|
|
throw new MWException(
|
|
|
|
|
"Bad content model: " .
|
2013-02-03 18:30:03 +00:00
|
|
|
"expected {$this->model_id} " .
|
2012-10-16 18:16:11 +00:00
|
|
|
"but got $modelId."
|
|
|
|
|
);
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::getContentHandler
|
2017-09-09 20:47:04 +00:00
|
|
|
* @return ContentHandler
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getContentHandler() {
|
2020-01-18 20:25:04 +00:00
|
|
|
return $this->getContentHandlerFactory()->getContentHandler( $this->getModel() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return IContentHandlerFactory
|
|
|
|
|
*/
|
|
|
|
|
protected function getContentHandlerFactory(): IContentHandlerFactory {
|
|
|
|
|
return MediaWikiServices::getInstance()->getContentHandlerFactory();
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::getDefaultFormat
|
2017-09-09 20:47:04 +00:00
|
|
|
* @return string
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getDefaultFormat() {
|
|
|
|
|
return $this->getContentHandler()->getDefaultFormat();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::getSupportedFormats
|
2017-09-09 20:47:04 +00:00
|
|
|
* @return string[]
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getSupportedFormats() {
|
|
|
|
|
return $this->getContentHandler()->getSupportedFormats();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-03 17:08:05 +00:00
|
|
|
* @since 1.21
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
|
|
|
|
* @param string $format
|
|
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return bool
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @see Content::isSupportedFormat
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function isSupportedFormat( $format ) {
|
|
|
|
|
if ( !$format ) {
|
|
|
|
|
return true; // this means "use the default"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->getContentHandler()->isSupportedFormat( $format );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @param string $format The serialization format to check.
|
|
|
|
|
*
|
|
|
|
|
* @throws MWException If the format is not supported by this content handler.
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
protected function checkFormat( $format ) {
|
|
|
|
|
if ( !$this->isSupportedFormat( $format ) ) {
|
2012-10-16 18:16:11 +00:00
|
|
|
throw new MWException(
|
|
|
|
|
"Format $format is not supported for content model " .
|
|
|
|
|
$this->getModel()
|
|
|
|
|
);
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
2018-06-26 21:14:43 +00:00
|
|
|
* @param string|null $format
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2012-10-16 18:16:11 +00:00
|
|
|
* @return string
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::serialize
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function serialize( $format = null ) {
|
|
|
|
|
return $this->getContentHandler()->serializeContent( $this, $format );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return bool
|
|
|
|
|
*
|
|
|
|
|
* @see Content::isEmpty
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function isEmpty() {
|
2012-10-08 15:26:11 +00:00
|
|
|
return $this->getSize() === 0;
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-03 17:08:05 +00:00
|
|
|
* Subclasses may override this to implement (light weight) validation.
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return bool Always true.
|
|
|
|
|
*
|
|
|
|
|
* @see Content::isValid
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function isValid() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-11-08 15:19:23 +00:00
|
|
|
* Decides whether two Content objects are equal.
|
|
|
|
|
* Two Content objects MUST not be considered equal if they do not share the same content model.
|
|
|
|
|
* Two Content objects that are equal SHOULD have the same serialization.
|
|
|
|
|
*
|
|
|
|
|
* This default implementation relies on equalsInternal() to determin whether the
|
|
|
|
|
* Content objects are logically equivalent. Subclasses that need to implement a custom
|
|
|
|
|
* equality check should consider overriding equalsInternal(). Subclasses that override
|
|
|
|
|
* equals() itself MUST make sure that the implementation returns false for $that === null,
|
|
|
|
|
* and true for $that === this. It MUST also return false if $that does not have the same
|
|
|
|
|
* content model.
|
|
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
2018-06-26 21:14:43 +00:00
|
|
|
* @param Content|null $that
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return bool
|
|
|
|
|
*
|
|
|
|
|
* @see Content::equals
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function equals( Content $that = null ) {
|
2020-01-09 23:48:34 +00:00
|
|
|
if ( $that === null ) {
|
2012-09-24 20:51:53 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( $that === $this ) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( $that->getModel() !== $this->getModel() ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 15:19:23 +00:00
|
|
|
// For type safety. Needed for odd cases like MessageContent using CONTENT_MODEL_WIKITEXT
|
|
|
|
|
if ( get_class( $that ) !== get_class( $this ) ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->equalsInternal( $that );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Checks whether $that is logically equal to this Content object.
|
|
|
|
|
*
|
|
|
|
|
* This method can be overwritten by subclasses that need to implement custom
|
|
|
|
|
* equality checks.
|
|
|
|
|
*
|
|
|
|
|
* This default implementation checks whether the serializations
|
|
|
|
|
* of $this and $that are the same: $this->serialize() === $that->serialize()
|
|
|
|
|
*
|
|
|
|
|
* Implementors can assume that $that is an instance of the same class
|
|
|
|
|
* as the present Content object, as long as equalsInternal() is only called
|
|
|
|
|
* by the standard implementation of equals().
|
|
|
|
|
*
|
|
|
|
|
* @note Do not call this method directly, call equals() instead.
|
|
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2020-06-30 16:53:40 +00:00
|
|
|
*
|
2018-11-08 15:19:23 +00:00
|
|
|
* @param Content $that
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
protected function equalsInternal( Content $that ) {
|
|
|
|
|
return $this->serialize() === $that->serialize();
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of DataUpdate objects for recording information about this
|
|
|
|
|
* Content in some secondary data store.
|
|
|
|
|
*
|
2015-02-15 19:34:43 +00:00
|
|
|
* This default implementation returns a LinksUpdate object and calls the
|
|
|
|
|
* SecondaryDataUpdates hook.
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
|
|
|
|
* Subclasses may override this to determine the secondary data updates more
|
2013-01-25 15:51:49 +00:00
|
|
|
* efficiently, preferably without the need to generate a parser output object.
|
2015-02-15 19:34:43 +00:00
|
|
|
* They should however make sure to call SecondaryDataUpdates to give extensions
|
|
|
|
|
* a chance to inject additional updates.
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2014-03-03 17:08:05 +00:00
|
|
|
* @since 1.21
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @param Title $title
|
2018-06-26 21:14:43 +00:00
|
|
|
* @param Content|null $old
|
2014-03-03 17:08:05 +00:00
|
|
|
* @param bool $recursive
|
2018-06-26 21:14:43 +00:00
|
|
|
* @param ParserOutput|null $parserOutput
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return DataUpdate[]
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @see Content::getSecondaryDataUpdates()
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2014-03-03 17:08:05 +00:00
|
|
|
public function getSecondaryDataUpdates( Title $title, Content $old = null,
|
2015-02-15 19:34:43 +00:00
|
|
|
$recursive = true, ParserOutput $parserOutput = null
|
|
|
|
|
) {
|
2013-01-25 15:51:00 +00:00
|
|
|
if ( $parserOutput === null ) {
|
2012-09-24 20:51:53 +00:00
|
|
|
$parserOutput = $this->getParserOutput( $title, null, null, false );
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-17 09:09:32 +00:00
|
|
|
$updates = [
|
2015-02-15 19:34:43 +00:00
|
|
|
new LinksUpdate( $title, $parserOutput, $recursive )
|
2016-02-17 09:09:32 +00:00
|
|
|
];
|
2015-02-15 19:34:43 +00:00
|
|
|
|
Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-03-19 02:42:09 +00:00
|
|
|
Hooks::runner()->onSecondaryDataUpdates( $title, $old, $recursive, $parserOutput, $updates );
|
2015-02-15 19:34:43 +00:00
|
|
|
|
|
|
|
|
return $updates;
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @return Title[]|null
|
|
|
|
|
*
|
|
|
|
|
* @see Content::getRedirectChain
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getRedirectChain() {
|
|
|
|
|
global $wgMaxRedirects;
|
|
|
|
|
$title = $this->getRedirectTarget();
|
2020-01-09 23:48:34 +00:00
|
|
|
if ( $title === null ) {
|
2012-09-24 20:51:53 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
2020-11-11 21:21:59 +00:00
|
|
|
$wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory();
|
2012-09-24 20:51:53 +00:00
|
|
|
// recursive check to follow double redirects
|
|
|
|
|
$recurse = $wgMaxRedirects;
|
2016-02-17 09:09:32 +00:00
|
|
|
$titles = [ $title ];
|
2012-09-24 20:51:53 +00:00
|
|
|
while ( --$recurse > 0 ) {
|
|
|
|
|
if ( $title->isRedirect() ) {
|
2020-11-11 21:21:59 +00:00
|
|
|
$page = $wikiPageFactory->newFromTitle( $title );
|
2012-09-24 20:51:53 +00:00
|
|
|
$newtitle = $page->getRedirectTarget();
|
|
|
|
|
} else {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// Redirects to some special pages are not permitted
|
2013-11-20 04:49:59 +00:00
|
|
|
if ( $newtitle instanceof Title && $newtitle->isValidRedirectTarget() ) {
|
2012-09-24 20:51:53 +00:00
|
|
|
// The new title passes the checks, so make that our current
|
|
|
|
|
// title so that further recursion can be checked
|
|
|
|
|
$title = $newtitle;
|
|
|
|
|
$titles[] = $newtitle;
|
|
|
|
|
} else {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-11-19 21:26:16 +00:00
|
|
|
|
2012-09-24 20:51:53 +00:00
|
|
|
return $titles;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-03 17:08:05 +00:00
|
|
|
* Subclasses that implement redirects should override this.
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2016-07-01 00:08:44 +00:00
|
|
|
* @return Title|null
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::getRedirectTarget
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getRedirectTarget() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-03 17:08:05 +00:00
|
|
|
* @note Migrated here from Title::newFromRedirectRecurse.
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @return Title|null
|
|
|
|
|
*
|
|
|
|
|
* @see Content::getUltimateRedirectTarget
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getUltimateRedirectTarget() {
|
|
|
|
|
$titles = $this->getRedirectChain();
|
2013-11-19 21:26:16 +00:00
|
|
|
|
2012-09-24 20:51:53 +00:00
|
|
|
return $titles ? array_pop( $titles ) : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-10-05 13:03:24 +00:00
|
|
|
* @since 1.21
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
|
|
|
|
* @return bool
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::isRedirect
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function isRedirect() {
|
|
|
|
|
return $this->getRedirectTarget() !== null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This default implementation always returns $this.
|
2014-03-03 17:08:05 +00:00
|
|
|
* Subclasses that implement redirects should override this.
|
2012-10-16 18:16:11 +00:00
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-05 13:03:24 +00:00
|
|
|
* @since 1.21
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @param Title $target
|
|
|
|
|
*
|
2012-09-24 20:51:53 +00:00
|
|
|
* @return Content $this
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::updateRedirect
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function updateRedirect( Title $target ) {
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2017-09-09 20:47:04 +00:00
|
|
|
* @param string|int $sectionId
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return null
|
|
|
|
|
*
|
|
|
|
|
* @see Content::getSection
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function getSection( $sectionId ) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2017-09-09 20:47:04 +00:00
|
|
|
* @param string|int|null|bool $sectionId
|
|
|
|
|
* @param Content $with
|
|
|
|
|
* @param string $sectionTitle
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return null
|
|
|
|
|
*
|
|
|
|
|
* @see Content::replaceSection
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2014-06-12 14:05:18 +00:00
|
|
|
public function replaceSection( $sectionId, Content $with, $sectionTitle = '' ) {
|
2012-09-24 20:51:53 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2017-09-09 20:47:04 +00:00
|
|
|
* @param Title $title
|
|
|
|
|
* @param User $user
|
|
|
|
|
* @param ParserOptions $popts
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return Content $this
|
|
|
|
|
*
|
|
|
|
|
* @see Content::preSaveTransform
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2017-09-09 20:47:04 +00:00
|
|
|
* @param string $header
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return Content $this
|
|
|
|
|
*
|
|
|
|
|
* @see Content::addSectionHeader
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function addSectionHeader( $header ) {
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2017-09-09 20:47:04 +00:00
|
|
|
* @param Title $title
|
|
|
|
|
* @param ParserOptions $popts
|
|
|
|
|
* @param array $params
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return Content $this
|
|
|
|
|
*
|
|
|
|
|
* @see Content::preloadTransform
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2016-02-17 09:09:32 +00:00
|
|
|
public function preloadTransform( Title $title, ParserOptions $popts, $params = [] ) {
|
2012-09-24 20:51:53 +00:00
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
2017-09-09 20:47:04 +00:00
|
|
|
* @param WikiPage $page
|
|
|
|
|
* @param int $flags
|
|
|
|
|
* @param int $parentRevId
|
|
|
|
|
* @param User $user
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return Status
|
|
|
|
|
*
|
|
|
|
|
* @see Content::prepareSave
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2015-03-11 07:21:30 +00:00
|
|
|
public function prepareSave( WikiPage $page, $flags, $parentRevId, User $user ) {
|
2012-09-24 20:51:53 +00:00
|
|
|
if ( $this->isValid() ) {
|
|
|
|
|
return Status::newGood();
|
|
|
|
|
} else {
|
|
|
|
|
return Status::newFatal( "invalid-content-data" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-05 13:03:24 +00:00
|
|
|
* @since 1.21
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @param WikiPage $page
|
2017-09-09 20:47:04 +00:00
|
|
|
* @param ParserOutput|null $parserOutput
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2018-02-25 02:49:08 +00:00
|
|
|
* @return DeferrableUpdate[]
|
2014-03-03 17:08:05 +00:00
|
|
|
*
|
|
|
|
|
* @see Content::getDeletionUpdates
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
2014-03-03 17:08:05 +00:00
|
|
|
public function getDeletionUpdates( WikiPage $page, ParserOutput $parserOutput = null ) {
|
2016-02-17 09:09:32 +00:00
|
|
|
return [
|
2012-09-24 20:51:53 +00:00
|
|
|
new LinksDeletionUpdate( $page ),
|
2016-02-17 09:09:32 +00:00
|
|
|
];
|
2012-09-24 20:51:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2013-11-20 04:49:59 +00:00
|
|
|
* This default implementation always returns false. Subclasses may override
|
|
|
|
|
* this to supply matching logic.
|
2012-09-24 20:51:53 +00:00
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2012-10-16 18:16:11 +00:00
|
|
|
* @since 1.21
|
|
|
|
|
*
|
2012-09-24 20:51:53 +00:00
|
|
|
* @param MagicWord $word
|
|
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @return bool Always false.
|
|
|
|
|
*
|
|
|
|
|
* @see Content::matchMagicWord
|
2012-09-24 20:51:53 +00:00
|
|
|
*/
|
|
|
|
|
public function matchMagicWord( MagicWord $word ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2012-11-05 15:53:48 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This base implementation calls the hook ConvertContent to enable custom conversions.
|
|
|
|
|
* Subclasses may override this to implement conversion for "their" content model.
|
|
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2020-06-30 16:53:40 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @param string $toModel
|
|
|
|
|
* @param string $lossy
|
|
|
|
|
*
|
|
|
|
|
* @return Content|bool
|
2012-11-05 15:53:48 +00:00
|
|
|
*
|
2014-03-03 17:08:05 +00:00
|
|
|
* @see Content::convert()
|
2012-11-05 15:53:48 +00:00
|
|
|
*/
|
|
|
|
|
public function convert( $toModel, $lossy = '' ) {
|
|
|
|
|
if ( $this->getModel() === $toModel ) {
|
2015-09-11 13:44:59 +00:00
|
|
|
// nothing to do, shorten out.
|
2012-11-05 15:53:48 +00:00
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lossy = ( $lossy === 'lossy' ); // string flag, convert to boolean for convenience
|
|
|
|
|
$result = false;
|
|
|
|
|
|
Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-03-19 02:42:09 +00:00
|
|
|
Hooks::runner()->onConvertContent( $this, $toModel, $lossy, $result );
|
2013-11-19 21:26:16 +00:00
|
|
|
|
2012-11-05 15:53:48 +00:00
|
|
|
return $result;
|
|
|
|
|
}
|
2012-10-16 10:38:20 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a ParserOutput object containing information derived from this content.
|
|
|
|
|
* Most importantly, unless $generateHtml was false, the return value contains an
|
|
|
|
|
* HTML representation of the content.
|
|
|
|
|
*
|
|
|
|
|
* Subclasses that want to control the parser output may override this, but it is
|
|
|
|
|
* preferred to override fillParserOutput() instead.
|
|
|
|
|
*
|
|
|
|
|
* Subclasses that override getParserOutput() itself should take care to call the
|
|
|
|
|
* ContentGetParserOutput hook.
|
|
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2020-06-30 16:53:40 +00:00
|
|
|
*
|
2012-10-16 10:38:20 +00:00
|
|
|
* @since 1.24
|
|
|
|
|
*
|
|
|
|
|
* @param Title $title Context title for parsing
|
2019-06-27 07:17:06 +00:00
|
|
|
* @param int|null $revId Revision ID being rendered
|
2017-12-28 15:06:10 +00:00
|
|
|
* @param ParserOptions|null $options
|
2012-10-16 10:38:20 +00:00
|
|
|
* @param bool $generateHtml Whether or not to generate HTML
|
|
|
|
|
*
|
|
|
|
|
* @return ParserOutput Containing information derived from this content.
|
|
|
|
|
*/
|
|
|
|
|
public function getParserOutput( Title $title, $revId = null,
|
|
|
|
|
ParserOptions $options = null, $generateHtml = true
|
|
|
|
|
) {
|
|
|
|
|
if ( $options === null ) {
|
2018-07-11 16:13:18 +00:00
|
|
|
$options = ParserOptions::newCanonical( 'canonical' );
|
2012-10-16 10:38:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$po = new ParserOutput();
|
2018-08-07 16:52:40 +00:00
|
|
|
$options->registerWatcher( [ $po, 'recordOption' ] );
|
2012-10-16 10:38:20 +00:00
|
|
|
|
Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-03-19 02:42:09 +00:00
|
|
|
if ( Hooks::runner()->onContentGetParserOutput(
|
|
|
|
|
$this, $title, $revId, $options, $generateHtml, $po )
|
2017-07-01 08:32:08 +00:00
|
|
|
) {
|
2014-05-02 20:16:51 +00:00
|
|
|
// Save and restore the old value, just in case something is reusing
|
|
|
|
|
// the ParserOptions object in some weird way.
|
|
|
|
|
$oldRedir = $options->getRedirectTarget();
|
|
|
|
|
$options->setRedirectTarget( $this->getRedirectTarget() );
|
2012-10-16 10:38:20 +00:00
|
|
|
$this->fillParserOutput( $title, $revId, $options, $generateHtml, $po );
|
2014-05-02 20:16:51 +00:00
|
|
|
$options->setRedirectTarget( $oldRedir );
|
2012-10-16 10:38:20 +00:00
|
|
|
}
|
|
|
|
|
|
Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-03-19 02:42:09 +00:00
|
|
|
Hooks::runner()->onContentAlterParserOutput( $this, $title, $po );
|
2018-08-07 16:52:40 +00:00
|
|
|
$options->registerWatcher( null );
|
2014-09-19 10:09:54 +00:00
|
|
|
|
2012-10-16 10:38:20 +00:00
|
|
|
return $po;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fills the provided ParserOutput with information derived from the content.
|
|
|
|
|
* Unless $generateHtml was false, this includes an HTML representation of the content.
|
|
|
|
|
*
|
|
|
|
|
* This is called by getParserOutput() after consulting the ContentGetParserOutput hook.
|
|
|
|
|
* Subclasses are expected to override this method (or getParserOutput(), if need be).
|
|
|
|
|
* Subclasses of TextContent should generally override getHtml() instead.
|
|
|
|
|
*
|
|
|
|
|
* This placeholder implementation always throws an exception.
|
|
|
|
|
*
|
2020-07-13 08:57:12 +00:00
|
|
|
* @stable to override
|
2020-06-30 16:53:40 +00:00
|
|
|
*
|
2012-10-16 10:38:20 +00:00
|
|
|
* @since 1.24
|
|
|
|
|
*
|
|
|
|
|
* @param Title $title Context title for parsing
|
2019-06-27 07:17:06 +00:00
|
|
|
* @param int|null $revId ID of the revision being rendered.
|
|
|
|
|
* See Parser::parse() for the ramifications.
|
2017-12-28 15:06:10 +00:00
|
|
|
* @param ParserOptions $options
|
2012-10-16 10:38:20 +00:00
|
|
|
* @param bool $generateHtml Whether or not to generate HTML
|
|
|
|
|
* @param ParserOutput &$output The output object to fill (reference).
|
|
|
|
|
*
|
|
|
|
|
* @throws MWException
|
|
|
|
|
*/
|
|
|
|
|
protected function fillParserOutput( Title $title, $revId,
|
|
|
|
|
ParserOptions $options, $generateHtml, ParserOutput &$output
|
|
|
|
|
) {
|
|
|
|
|
// Don't make abstract, so subclasses that override getParserOutput() directly don't fail.
|
|
|
|
|
throw new MWException( 'Subclasses of AbstractContent must override fillParserOutput!' );
|
|
|
|
|
}
|
2012-10-17 16:16:23 +00:00
|
|
|
}
|