MediaWiki
REL1_22
|
Base content handler implementation for flat text contents. More...
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. |
Base content handler implementation for flat text contents.
Definition at line 31 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.
string | $modelId | (use CONTENT_MODEL_XXX constants). |
array | $formats | List for supported serialization formats (typically as MIME types) |
Reimplemented from ContentHandler.
Definition at line 33 of file TextContentHandler.php.
Creates an empty TextContent object.
Reimplemented from ContentHandler.
Reimplemented in RevisionTestModifyableContentHandler, WikitextContentHandler, CssContentHandler, and JavaScriptContentHandler.
Definition at line 112 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 64 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 44 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, WikitextContentHandler, CssContentHandler, and JavaScriptContentHandler.
Definition at line 99 of file TextContentHandler.php.
References ContentHandler\checkFormat().
Referenced by merge3().