MediaWiki
master
|
Public Member Functions | |
__construct ($modelId=CONTENT_MODEL_TEXT, $formats=array(CONTENT_FORMAT_TEXT)) | |
Constructor, initializing the ContentHandler instance with its model ID and a list of supported formats. | |
makeEmptyContent () | |
Creates an empty TextContent object. | |
merge3 (Content $oldContent, Content $myContent, Content $yourContent) | |
Attempts to merge differences between three versions. | |
serializeContent (Content $content, $format=null) | |
Returns the content's text as-is. | |
unserializeContent ($text, $format=null) | |
Unserializes a Content object of the type supported by this ContentHandler. |
Definition at line 6 of file TextContentHandler.php.
TextContentHandler::__construct | ( | $ | modelId = CONTENT_MODEL_TEXT , |
$ | formats = array( CONTENT_FORMAT_TEXT ) |
||
) |
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.
$modelId | String (use CONTENT_MODEL_XXX constants). |
$formats | array List for supported serialization formats (typically as MIME types) |
Reimplemented from ContentHandler.
Definition at line 8 of file TextContentHandler.php.
Creates an empty TextContent object.
Reimplemented from ContentHandler.
Reimplemented in RevisionTestModifyableContentHandler, WikitextContentHandler, JavaScriptContentHandler, and CssContentHandler.
Definition at line 87 of file TextContentHandler.php.
Referenced by merge3().
TextContentHandler::merge3 | ( | Content $ | oldContent, |
Content $ | myContent, | ||
Content $ | yourContent | ||
) |
Attempts to merge differences between three versions.
Returns a new Content object for a clean merge and false for failure or a conflict.
All three Content objects passed as parameters must have the same content model.
This text-based implementation uses wfMerge().
$oldContent | Content|string String |
$myContent | Content|string String |
$yourContent | Content|string String |
Reimplemented from ContentHandler.
Definition at line 39 of file TextContentHandler.php.
References $ok, $result, ContentHandler\checkModelID(), ContentHandler\getDefaultFormat(), Content\getModel(), makeEmptyContent(), serializeContent(), unserializeContent(), and wfMerge().
TextContentHandler::serializeContent | ( | Content $ | content, |
$ | format = null |
||
) |
Returns the content's text as-is.
$content | Content |
$format | string|null |
Reimplemented from ContentHandler.
Definition at line 19 of file TextContentHandler.php.
References ContentHandler\checkFormat(), and Content\getNativeData().
Referenced by merge3().
TextContentHandler::unserializeContent | ( | $ | text, |
$ | format = null |
||
) |
Unserializes a Content object of the type supported by this ContentHandler.
$text | string serialized form of the content |
$format | null|String the format used for serialization |
Reimplemented from ContentHandler.
Reimplemented in RevisionTestModifyableContentHandler, JavaScriptContentHandler, CssContentHandler, and WikitextContentHandler.
Definition at line 74 of file TextContentHandler.php.
References ContentHandler\checkFormat().
Referenced by merge3().