MediaWiki
1.27.1
|
A content handler knows how do deal with a specific type of content on a wiki page. More...
Public Member Functions | |
__construct ($modelId, $formats) | |
Constructor, initializing the ContentHandler instance with its model ID and a list of supported formats. More... | |
canBeUsedOn (Title $title) | |
Determines whether the content type handled by this ContentHandler can be used on the given page. More... | |
createDifferenceEngine (IContextSource $context, $old=0, $new=0, $rcid=0, $refreshCache=false, $unhide=false) | |
Factory for creating an appropriate DifferenceEngine for this content model. More... | |
exportTransform ($blob, $format=null) | |
Applies transformations on export (returns the blob unchanged per default). More... | |
getActionOverrides () | |
Returns overrides for action handlers. More... | |
getAutoDeleteReason (Title $title, &$hasHistory) | |
Auto-generates a deletion reason. More... | |
getAutosummary (Content $oldContent=null, Content $newContent=null, $flags) | |
Return an applicable auto-summary if one exists for the given edit. More... | |
getDefaultFormat () | |
The format used for serialization/deserialization by default by this ContentHandler. More... | |
getModelID () | |
Returns the model id that identifies the content model this ContentHandler can handle. More... | |
getPageLanguage (Title $title, Content $content=null) | |
Get the language in which the content of the given page is written. More... | |
getPageViewLanguage (Title $title, Content $content=null) | |
Get the language in which the content of this page is written when viewed by user. More... | |
getSupportedFormats () | |
Returns a list of serialization formats supported by the serializeContent() and unserializeContent() methods of this ContentHandler. More... | |
getUndoContent (Revision $current, Revision $undo, Revision $undoafter) | |
Get the Content object that needs to be saved in order to undo all revisions between $undo and $undoafter. More... | |
importTransform ($blob, $format=null) | |
Apply import transformation (per default, returns $blob unchanged). More... | |
isParserCacheSupported () | |
Returns true for content models that support caching using the ParserCache mechanism. More... | |
isSupportedFormat ($format) | |
Returns true if $format is a serialization format supported by this ContentHandler, and false otherwise. More... | |
makeEmptyContent () | |
Creates an empty Content object of the type supported by this ContentHandler. More... | |
makeParserOptions ($context) | |
Get parser options suitable for rendering and caching the article. More... | |
makeRedirectContent (Title $destination, $text= '') | |
Creates a new Content object that acts as a redirect to the given page, or null if redirects are not supported by this content model. More... | |
merge3 (Content $oldContent, Content $myContent, Content $yourContent) | |
Attempts to merge differences between three versions. More... | |
serializeContent (Content $content, $format=null) | |
Serializes a Content object of the type supported by this ContentHandler. More... | |
supportsCategories () | |
Returns true if this content model supports categories. More... | |
supportsDirectApiEditing () | |
Whether or not this content model supports direct editing via ApiEditPage. More... | |
supportsDirectEditing () | |
Return true if this content model supports direct editing, such as via EditPage. More... | |
supportsRedirects () | |
Returns true if this content model supports redirects. More... | |
supportsSections () | |
Returns true if this content model supports sections. More... | |
unserializeContent ($blob, $format=null) | |
Unserializes a Content object of the type supported by this ContentHandler. More... | |
Static Public Member Functions | |
static | deprecated ($func, $version, $component=false) |
Logs a deprecation warning, visible if $wgDevelopmentWarnings, but only if self::$enableDeprecationWarnings is set to true. More... | |
static | getAllContentFormats () |
static | getContentModels () |
static | getContentText (Content $content=null) |
Convenience function for getting flat text from a Content object. More... | |
static | getDefaultModelFor (Title $title) |
Returns the name of the default content model to be used for the page with the given title. More... | |
static | getForContent (Content $content) |
Returns the appropriate ContentHandler singleton for the given Content object. More... | |
static | getForModelID ($modelId) |
Returns the ContentHandler singleton for the given model ID. More... | |
static | getForTitle (Title $title) |
Returns the appropriate ContentHandler singleton for the given title. More... | |
static | getLocalizedName ($name, Language $lang=null) |
Returns the localized name for a given content model. More... | |
static | makeContent ($text, Title $title=null, $modelId=null, $format=null) |
Convenience function for creating a Content object from a given textual representation. More... | |
static | runLegacyHooks ($event, $args=[], $warn=null) |
Call a legacy hook that uses text instead of Content objects. More... | |
Protected Member Functions | |
checkFormat ($format) | |
Convenient for checking whether a format provided as a parameter is actually supported. More... | |
checkModelID ($model_id) | |
getDiffEngineClass () | |
Returns the name of the diff engine to use. More... | |
Protected Attributes | |
string | $mModelID |
string[] | $mSupportedFormats |
Static Protected Attributes | |
static | $enableDeprecationWarnings = false |
Switch for enabling deprecation warnings. More... | |
static array | $handlers |
A Cache of ContentHandler instances by model id. More... | |
A content handler knows how do deal with a specific type of content on a wiki page.
Content is stored in the database in a serialized form (using a serialization format a.k.a. MIME type) and is unserialized into its native PHP representation (the content model), which is wrapped in an instance of the appropriate subclass of Content.
ContentHandler instances are stateless singletons that serve, among other things, as a factory for Content objects. Generally, there is one subclass of ContentHandler and one subclass of Content for every type of content model.
Some content types have a flat model, that is, their native representation is the same as their serialized form. Examples would be JavaScript and CSS code. As of now, this also applies to wikitext (MediaWiki's default content type), but wikitext content may be represented by a DOM or AST structure in the future.
Definition at line 81 of file ContentHandler.php.
ContentHandler::__construct | ( | $modelId, | |
$formats | |||
) |
Constructor, initializing the ContentHandler instance with its model ID and a list of supported formats.
Values for the parameters are typically provided as literals by subclass's constructors.
string | $modelId | (use CONTENT_MODEL_XXX constants). |
string[] | $formats List for supported serialization formats (typically as MIME types) |
Definition at line 450 of file ContentHandler.php.
ContentHandler::canBeUsedOn | ( | Title | $title | ) |
Determines whether the content type handled by this ContentHandler can be used on the given page.
This default implementation always returns true. Subclasses may override this to restrict the use of this content model to specific locations, typically based on the namespace or some other aspect of the title, such as a special suffix (e.g. ".svg" for SVG content).
Title | $title | The page's title. |
Definition at line 764 of file ContentHandler.php.
References getModelID(), and Hooks\run().
|
protected |
Convenient for checking whether a format provided as a parameter is actually supported.
string | $format | The serialization format to check |
MWException | If the format is not supported by this content handler. |
Definition at line 627 of file ContentHandler.php.
References getModelID(), and isSupportedFormat().
Referenced by TextContentHandler\serializeContent(), and TextContentHandler\unserializeContent().
|
protected |
string | $model_id | The model to check |
MWException | If the model ID is not the ID of the content model supported by this ContentHandler. |
Definition at line 563 of file ContentHandler.php.
Referenced by getAutoDeleteReason(), getUndoContent(), and TextContentHandler\merge3().
ContentHandler::createDifferenceEngine | ( | IContextSource | $context, |
$old = 0 , |
|||
$new = 0 , |
|||
$rcid = 0 , |
|||
$refreshCache = false , |
|||
$unhide = false |
|||
) |
Factory for creating an appropriate DifferenceEngine for this content model.
IContextSource | $context | Context to use, anything else will be ignored. |
int | $old | Revision ID we want to show and diff with. |
int | string | $new | Either a revision ID or one of the strings 'cur', 'prev' or 'next'. |
int | $rcid | FIXME: Deprecated, no longer used. Defaults to 0. |
bool | $refreshCache | If set, refreshes the diff cache. Defaults to false. |
bool | $unhide | If set, allow viewing deleted revs. Defaults to false. |
Definition at line 664 of file ContentHandler.php.
References $differenceEngine, $refreshCache, $unhide, getDiffEngineClass(), and Hooks\run().
|
static |
Logs a deprecation warning, visible if $wgDevelopmentWarnings, but only if self::$enableDeprecationWarnings is set to true.
string | $func | The name of the deprecated function |
string | $version | The version since the method is deprecated. Usually 1.21 for ContentHandler related stuff. |
string | bool | $component | : Component to which the function belongs. If false, it is assumed the function is in MediaWiki core. |
Definition at line 1139 of file ContentHandler.php.
References $version, and wfDeprecated().
Referenced by WikiPage\doEdit(), Article\doEdit(), Article\fetchContent(), DifferenceEngine\generateDiffBody(), WikiPage\getAutosummary(), Article\getContent(), WikiRevision\getText(), WikiPage\getText(), Revision\getText(), Article\getText(), and WikiPage\prepareTextForEdit().
ContentHandler::exportTransform | ( | $blob, | |
$format = null |
|||
) |
Applies transformations on export (returns the blob unchanged per default).
Subclasses may override this to perform transformations such as conversion of legacy formats or filtering of internal meta-data.
string | $blob | The blob to be exported |
string | null | $format | The blob's serialization format |
Definition at line 481 of file ContentHandler.php.
References $blob.
ContentHandler::getActionOverrides | ( | ) |
Returns overrides for action handlers.
Classes listed here will be used instead of the default one when (and only when) $wgActions[$action] === true. This allows subclasses to override the default action handlers.
Definition at line 646 of file ContentHandler.php.
|
static |
Definition at line 414 of file ContentHandler.php.
References $handler, $wgContentHandlers, as, getForModelID(), and global.
Referenced by ApiStashEdit\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiEditPage\getAllowedParams(), and ApiParse\getAllowedParams().
ContentHandler::getAutoDeleteReason | ( | Title | $title, |
& | $hasHistory | ||
) |
Auto-generates a deletion reason.
Title | $title | The page's title |
bool | &$hasHistory | Whether the page has a history |
Definition at line 894 of file ContentHandler.php.
References $content, $dbr, $res, $rev, as, checkModelID(), DB_SLAVE, Revision\DELETED_USER, Title\getArticleID(), Revision\newFromTitle(), wfGetDB(), and wfMessage().
Return an applicable auto-summary if one exists for the given edit.
Content | $oldContent | The previous text of the page. |
Content | $newContent | The submitted text of the page. |
int | $flags | Bit mask: a bit mask of flags submitted for the edit. |
Definition at line 812 of file ContentHandler.php.
References $flags, EDIT_NEW, text, and wfMessage().
|
static |
Definition at line 408 of file ContentHandler.php.
References $wgContentHandlers, and global.
Referenced by ApiStashEdit\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParse\getAllowedParams(), and SpecialChangeContentModel\getOptionsForTitle().
|
static |
Convenience function for getting flat text from a Content object.
This should only be used in the context of backwards compatibility with code that is not yet able to handle Content objects!
If $content is null, this method returns the empty string.
If $content is an instance of TextContent, this method returns the flat text as returned by $content->getNativeData().
If $content is not a TextContent object, the behavior of this method depends on the global $wgContentHandlerTextFallback:
Content | $content |
MWException | If the content is not an instance of TextContent and wgContentHandlerTextFallback was set to 'fail'. |
Definition at line 120 of file ContentHandler.php.
References $content, global, and wfDebugLog().
Referenced by EditPageTest\assertEdit(), Article\fetchContent(), Article\getContent(), Revision\getText(), EditPage\internalAttemptSave(), WikiPage\prepareContentForEdit(), ContentHandlerTest\testGetContentText_NonTextContent_fail(), ContentHandlerTest\testGetContentText_NonTextContent_ignore(), ContentHandlerTest\testGetContentText_NonTextContent_serialize(), ContentHandlerTest\testGetContentText_Null(), and ContentHandlerTest\testGetContentText_TextContent().
ContentHandler::getDefaultFormat | ( | ) |
The format used for serialization/deserialization by default by this ContentHandler.
This default implementation will return the first element of the array of formats that was passed to the constructor.
Definition at line 595 of file ContentHandler.php.
Referenced by TextContentHandler\merge3().
|
static |
Returns the name of the default content model to be used for the page with the given title.
Note: There should rarely be need to call this method directly. To determine the actual content model for a given page, use Title::getContentModel().
Which model is to be used by default for the page is determined based on several factors:
If none of the above applies, the wikitext model is used.
Note: this is used by, and may thus not use, Title::getContentModel()
Title | $title |
Definition at line 219 of file ContentHandler.php.
References $ext, CONTENT_MODEL_CSS, CONTENT_MODEL_JAVASCRIPT, CONTENT_MODEL_JSON, CONTENT_MODEL_TEXT, CONTENT_MODEL_WIKITEXT, Title\getNamespace(), MWNamespace\getNamespaceContentModel(), Title\getText(), NS_MEDIAWIKI, NS_USER, and Hooks\run().
Referenced by Revision\checkContentModel(), Title\getContentModel(), Revision\getContentModel(), Revision\insertOn(), MovePage\moveToInternal(), PopulateContentModel\populatePage(), ContentHandlerTest\testGetDefaultModelFor(), WikiPageTest\testIsCountable(), and XmlDumpWriter\writeRevision().
|
protected |
Returns the name of the diff engine to use.
Definition at line 779 of file ContentHandler.php.
References class.
Referenced by createDifferenceEngine().
|
static |
Returns the appropriate ContentHandler singleton for the given Content object.
Content | $content |
Definition at line 303 of file ContentHandler.php.
References getForModelID(), and Content\getModel().
Referenced by AbstractContent\getContentHandler().
|
static |
Returns the ContentHandler singleton for the given model ID.
Use the CONTENT_MODEL_XXX constants to identify the desired content model.
ContentHandler singletons are taken from the global $wgContentHandlers array. Keys in that array are model names, the values are either ContentHandler singleton objects, or strings specifying the appropriate subclass of ContentHandler.
If a class name is encountered when looking up the singleton for a given model name, the class is instantiated and the class name is replaced by the resulting singleton in $wgContentHandlers.
If no ContentHandler is defined for the desired $modelId, the ContentHandler may be provided by the ContentHandlerForModelID hook. If no ContentHandler can be determined, an MWException is raised.
string | $modelId | The ID of the content model for which to get a handler. Use CONTENT_MODEL_XXX constants. |
MWException | For internal errors and problems in the configuration. |
MWUnknownContentModelException | If no handler is known for the model ID. |
Definition at line 340 of file ContentHandler.php.
References $handler, $handlers, $wgContentHandlers, global, Hooks\run(), and wfDebugLog().
Referenced by EditPage\__construct(), Revision\checkContentModel(), TextContent\convert(), ApiEditPage\execute(), ApiStashEdit\execute(), TextPassDumper\exportTransform(), ApiQueryRevisionsBase\extractRevisionInfo(), getAllContentFormats(), WikiPage\getAutosummary(), WikiPage\getContentHandler(), WikiRevision\getContentHandler(), Revision\getContentHandler(), EditPage\getCurrentContent(), getForContent(), getForTitle(), SpecialChangeContentModel\getOptionsForTitle(), EditPage\getOriginalContent(), EditPage\importFormData(), Revision\insertOn(), EditPage\isSupportedContentModel(), makeContent(), EditPage\mergeChangesIntoContent(), SpecialChangeContentModel\onSubmit(), WikitextContentHandlerTest\setUp(), EditPage\showConflict(), ContentHandlerTest\testGetModelForID(), PopulateContentModel\updateRevisionOrArchiveRows(), and XmlDumpWriter\writeRevision().
|
static |
Returns the appropriate ContentHandler singleton for the given title.
Title | $title |
Definition at line 287 of file ContentHandler.php.
References Title\getContentModel(), and getForModelID().
Referenced by CleanupSpam\cleanupArticle(), MovePageForm\doSubmit(), FeedUtils\formatDiffRow(), BrokenRedirectsPage\formatResult(), DoubleRedirectsPage\formatResult(), Article\generateReason(), ResourceLoaderWikiModule\getContent(), Title\getPageLanguage(), Title\getPageViewLanguage(), EditPage\getPreloadedContent(), MediaWiki\initializeArticle(), EditPage\isSectionEditSupported(), MergeHistory\merge(), MovePage\moveToInternal(), PopulateContentModel\populateRevisionOrArchive(), MovePageForm\showForm(), ContentHandlerTest\testGetForTitle(), ContentHandlerTest\testGetPageLanguage(), and SpecialWhatLinksHere\wlhLink().
|
static |
Returns the localized name for a given content model.
Model names are localized using system messages. Message keys have the form content-model-$name, where $name is getContentModelName( $id ).
string | $name | The content model ID, as given by a CONTENT_MODEL_XXX constant or returned by Revision::getContentModel(). |
Language | null | $lang | The language to parse the message in (since 1.26) |
MWException | If the model ID isn't known. |
Definition at line 395 of file ContentHandler.php.
References $key, $lang, $name, and wfMessage().
Referenced by WikiPage\doEditContent(), ContentModelLogFormatter\getMessageParameters(), SpecialChangeContentModel\getOptionsForTitle(), EditPage\importFormData(), MovePage\isValidMove(), SpecialChangeContentModel\onSubmit(), InfoAction\pageInfo(), ContentHandlerTest\testGetLocalizedName(), EditPage\toEditContent(), EditPage\toEditText(), and SpecialChangeContentModel\validateTitle().
ContentHandler::getModelID | ( | ) |
Returns the model id that identifies the content model this ContentHandler can handle.
Use with the CONTENT_MODEL_XXX constants.
Definition at line 551 of file ContentHandler.php.
References $mModelID.
Referenced by canBeUsedOn(), and checkFormat().
Get the language in which the content of the given page is written.
This default implementation just returns $wgContLang (except for pages in the MediaWiki namespace)
Note that the pages language is not cacheable, since it may in some cases depend on user settings.
Also note that the page language may or may not depend on the actual content of the page, that is, this method may load the content in order to determine the language.
Title | $title | The page to determine the language for. |
Content | $content | The page's content, if you have it handy, to avoid reloading it. |
Definition at line 698 of file ContentHandler.php.
References $lang, $wgContLang, $wgLang, Title\getNamespace(), Title\getText(), global, list, NS_MEDIAWIKI, Hooks\run(), MessageCache\singleton(), and wfGetLangObj().
Referenced by getPageViewLanguage().
Get the language in which the content of this page is written when viewed by user.
Defaults to $this->getPageLanguage(), but if the user specified a preferred variant, the variant will be used.
This default implementation just returns $this->getPageLanguage( $title, $content ) unless the user specified a preferred variant.
Note that the pages view language is not cacheable, since it depends on user settings.
Also note that the page language may or may not depend on the actual content of the page, that is, this method may load the content in order to determine the language.
Title | $title | The page to determine the language for. |
Content | $content | The page's content, if you have it handy, to avoid reloading it. |
Definition at line 733 of file ContentHandler.php.
References $content, Language\factory(), Title\getNamespace(), getPageLanguage(), and NS_MEDIAWIKI.
ContentHandler::getSupportedFormats | ( | ) |
Returns a list of serialization formats supported by the serializeContent() and unserializeContent() methods of this ContentHandler.
Definition at line 580 of file ContentHandler.php.
References $mSupportedFormats.
Get the Content object that needs to be saved in order to undo all revisions between $undo and $undoafter.
Revisions must belong to the same page, must exist and must not be deleted.
Revision | $current | The current text |
Revision | $undo | The revision to undo |
Revision | $undoafter | Must be an earlier revision than $undo |
Definition at line 999 of file ContentHandler.php.
References checkModelID(), Revision\getContent(), and merge3().
ContentHandler::importTransform | ( | $blob, | |
$format = null |
|||
) |
Apply import transformation (per default, returns $blob unchanged).
This gives subclasses an opportunity to transform data blobs on import.
string | $blob | |
string | null | $format |
Definition at line 508 of file ContentHandler.php.
References $blob.
ContentHandler::isParserCacheSupported | ( | ) |
Returns true for content models that support caching using the ParserCache mechanism.
See WikiPage::shouldCheckParserCache().
Definition at line 1068 of file ContentHandler.php.
ContentHandler::isSupportedFormat | ( | $format | ) |
Returns true if $format is a serialization format supported by this ContentHandler, and false otherwise.
Note that if $format is null, this method always returns true, because null means "use the default format".
string | $format | The serialization format to check |
Definition at line 612 of file ContentHandler.php.
Referenced by checkFormat().
|
static |
Convenience function for creating a Content object from a given textual representation.
$text will be deserialized into a Content object of the model specified by $modelId (or, if that is not given, $title->getContentModel()) using the given format.
string | $text | The textual representation, will be unserialized to create the Content object |
Title | $title | The title of the page this text belongs to. Required if $modelId is not provided. |
string | $modelId | The model to deserialize to. If not provided, $title->getContentModel() is used. |
string | $format | The format to use for deserialization. If not given, the model's default format is used. |
MWException | If model ID or format is not supported or if the text can not be unserialized using the format. |
Definition at line 170 of file ContentHandler.php.
References $handler, $title, and getForModelID().
Referenced by PoolWorkArticleView\__construct(), ParserTest\addArticle(), DumpTestCase\addRevision(), FetchTextTest\addRevision(), EditPageTest\assertEdit(), WikiPageTest\createPage(), RevisionStorageTest\createPage(), TestPageProps\createPage(), WikiPage\doEdit(), DifferenceEngineTest\doEdits(), ApiTestCase\editPage(), CategoryMembershipChangeJobTest\editPageText(), ApiEditPage\execute(), MakeTestEdits\execute(), ImportSiteScripts\execute(), ApiParse\execute(), ApiStashEdit\execute(), EditCLI\execute(), ApiQueryRevisionsBase\extractRevisionInfo(), Article\getContentObject(), MediaWikiTestCase\insertPage(), MessageCacheTest\makePage(), RevisionTest\newTestRevision(), SpecialChangeContentModel\onSubmit(), WikiPage\prepareTextForEdit(), LocalFile\recordUpload2(), RevisionTest\testConstructWithContent(), TextContentTest\testDeletionUpdates(), WikiPageTest\testDoEditContent(), WikiPageTest\testDoQuickEditContent(), ApiEditPageTest\testEditSection(), ContentHandlerTest\testGetAutosummary(), RevisionStorageTest\testGetNext(), TextContentTest\testGetParserOutput(), RevisionStorageTest\testGetPrevious(), WikitextContentTest\testGetSecondaryDataUpdates(), RevisionStorageTest\testIsCurrent(), ContentHandlerTest\testMakeContent(), RefreshLinksPartitionTest\testRefreshLinks(), and EditPage\toEditContent().
|
abstract |
Creates an empty Content object of the type supported by this ContentHandler.
ContentHandler::makeParserOptions | ( | $context | ) |
Get parser options suitable for rendering and caching the article.
IContextSource | User | string | $context | One of the following:
|
MWException |
Definition at line 1041 of file ContentHandler.php.
References $context, $options, $wgContLang, global, ParserOptions\newFromContext(), ParserOptions\newFromUser(), and ParserOptions\newFromUserAndLang().
ContentHandler::makeRedirectContent | ( | Title | $destination, |
$text = '' |
|||
) |
Creates a new Content object that acts as a redirect to the given page, or null if redirects are not supported by this content model.
This default implementation always returns null. Subclasses supporting redirects must override this method.
Note that subclasses that override this method to return a Content object should also override supportsRedirects() to return true.
Title | $destination | The page to redirect to. |
string | $text | Text to include in the redirect, if possible. |
Definition at line 539 of file ContentHandler.php.
Attempts to merge differences between three versions.
Returns a new Content object for a clean merge and false for failure or a conflict.
This default implementation always returns false.
Content | $oldContent | The page's previous content. |
Content | $myContent | One of the page's conflicting contents. |
Content | $yourContent | One of the page's conflicting contents. |
Definition at line 797 of file ContentHandler.php.
Referenced by getUndoContent().
|
static |
Call a legacy hook that uses text instead of Content objects.
Will log a warning when a matching hook function is registered. If the textual representation of the content is changed by the hook function, a new Content object is constructed from the new text.
string | $event | Event name |
array | $args | Parameters passed to hook functions |
bool | $warn | Whether to log a warning. Default to self::$enableDeprecationWarnings. May be set to false for testing. |
Definition at line 1162 of file ContentHandler.php.
References $args, $content, $handler, as, Hooks\getHandlers(), Hooks\isRegistered(), Hooks\run(), and wfWarn().
Referenced by WikiPage\doCreate(), WikiPage\doEditContent(), WikiPage\doModify(), Article\fetchContent(), EditPage\getPreviewText(), DifferenceEngine\renderNewRevision(), EditPage\runPostMergeFilters(), Article\showCssOrJsPage(), EditPage\showDiff(), ContentHandlerTest\testRunLegacyHooks(), and Article\view().
|
abstract |
Serializes a Content object of the type supported by this ContentHandler.
Content | $content | The Content object to serialize |
string | $format | The desired serialization format |
ContentHandler::supportsCategories | ( | ) |
Returns true if this content model supports categories.
The default implementation returns true.
Definition at line 1091 of file ContentHandler.php.
ContentHandler::supportsDirectApiEditing | ( | ) |
Whether or not this content model supports direct editing via ApiEditPage.
Definition at line 1122 of file ContentHandler.php.
References supportsDirectEditing().
ContentHandler::supportsDirectEditing | ( | ) |
Return true if this content model supports direct editing, such as via EditPage.
Definition at line 1113 of file ContentHandler.php.
Referenced by supportsDirectApiEditing(), and WikitextContentHandlerTest\testSupportsDirectEditing().
ContentHandler::supportsRedirects | ( | ) |
Returns true if this content model supports redirects.
This default implementation returns false.
Content models that return true here should also implement ContentHandler::makeRedirectContent to return a Content object.
Definition at line 1104 of file ContentHandler.php.
ContentHandler::supportsSections | ( | ) |
Returns true if this content model supports sections.
This default implementation returns false.
Content models that return true here should also implement Content::getSection, Content::replaceSection, etc. to handle sections..
Definition at line 1081 of file ContentHandler.php.
|
abstract |
Unserializes a Content object of the type supported by this ContentHandler.
string | $blob | Serialized form of the content |
string | $format | The format used for serialization |
|
staticprotected |
Switch for enabling deprecation warnings.
Used by ContentHandler::deprecated() and ContentHandler::runLegacyHooks().
Once the ContentHandler code has settled in a bit, this should be set to true to make extensions etc. show warnings when using deprecated functions and hooks.
Definition at line 89 of file ContentHandler.php.
|
staticprotected |
A Cache of ContentHandler instances by model id.
Definition at line 312 of file ContentHandler.php.
Referenced by getForModelID().
|
protected |
Definition at line 434 of file ContentHandler.php.
Referenced by getModelID().
|
protected |
Definition at line 439 of file ContentHandler.php.
Referenced by getSupportedFormats().