From 305964b3376a1005bb26cc18664cd8d9996ca1f8 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 17 Apr 2012 18:04:27 +0200 Subject: [PATCH] renamed serialize/unserialize to serializeContent/unserializeContent --- includes/Content.php | 4 ++-- includes/ContentHandler.php | 24 ++++++++++++------------ includes/DefaultSettings.php | 2 +- includes/WikiPage.php | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/includes/Content.php b/includes/Content.php index d8fbf7cf21..55859da37b 100644 --- a/includes/Content.php +++ b/includes/Content.php @@ -148,13 +148,13 @@ abstract class Content { /** * Conveniance method for serializing this Content object. * - * Shorthand for $this->getContentHandler()->serialize( $this, $format ) + * Shorthand for $this->getContentHandler()->serializeContent( $this, $format ) * * @param null|String $format the desired serialization format (or null for the default format). * @return String serialized form of this Content object */ public function serialize( $format = null ) { - return $this->getContentHandler()->serialize( $this, $format ); + return $this->getContentHandler()->serializeContent( $this, $format ); } /** diff --git a/includes/ContentHandler.php b/includes/ContentHandler.php index b1e5827d02..6a1497817b 100644 --- a/includes/ContentHandler.php +++ b/includes/ContentHandler.php @@ -85,7 +85,7 @@ abstract class ContentHandler { } $handler = ContentHandler::getForModelName( $modelName ); - return $handler->unserialize( $text, $format ); + return $handler->unserializeContent( $text, $format ); } /** @@ -263,7 +263,7 @@ abstract class ContentHandler { * @param null $format the desired serialization format * @return String serialized form of the content */ - public abstract function serialize( Content $content, $format = null ); + public abstract function serializeContent( Content $content, $format = null ); /** * Unserializes a Content object of the type supported by this ContentHandler. @@ -275,7 +275,7 @@ abstract class ContentHandler { * @param null $format the format used for serialization * @return Content the Content object created by deserializing $blob */ - public abstract function unserialize( $blob, $format = null ); + public abstract function unserializeContent( $blob, $format = null ); /** * Creates an empty Content object of the type supported by this ContentHandler. @@ -306,7 +306,7 @@ abstract class ContentHandler { } /** - * Returns a list of serialization formats supported by the serialize() and unserialize() methods of + * Returns a list of serialization formats supported by the serializeContent() and unserializeContent() methods of * this ContentHandler. * * @return array of serialization formats as MIME type like strings @@ -647,7 +647,7 @@ abstract class TextContentHandler extends ContentHandler { parent::__construct( $modelName, $formats ); } - public function serialize( Content $content, $format = null ) { + public function serializeContent( Content $content, $format = null ) { $this->checkFormat( $format ); return $content->getNativeData(); } @@ -669,9 +669,9 @@ abstract class TextContentHandler extends ContentHandler { $format = $this->getDefaultFormat(); - $old = $this->serialize( $oldContent, $format ); - $mine = $this->serialize( $myContent, $format ); - $yours = $this->serialize( $yourContent, $format ); + $old = $this->serializeContent( $oldContent, $format ); + $mine = $this->serializeContent( $myContent, $format ); + $yours = $this->serializeContent( $yourContent, $format ); $ok = wfMerge( $old, $mine, $yours, $result ); @@ -683,7 +683,7 @@ abstract class TextContentHandler extends ContentHandler { return $this->emptyContent(); } - $mergedContent = $this->unserialize( $result, $format ); + $mergedContent = $this->unserializeContent( $result, $format ); return $mergedContent; } @@ -695,7 +695,7 @@ class WikitextContentHandler extends TextContentHandler { parent::__construct( $modelName, array( 'application/x-wikitext' ) ); #FIXME: mime } - public function unserialize( $text, $format = null ) { + public function unserializeContent( $text, $format = null ) { $this->checkFormat( $format ); return new WikitextContent( $text ); @@ -716,7 +716,7 @@ class JavaScriptContentHandler extends TextContentHandler { parent::__construct( $modelName, array( 'text/javascript' ) ); #XXX: or use $wgJsMimeType? this is for internal storage, not HTTP... } - public function unserialize( $text, $format = null ) { + public function unserializeContent( $text, $format = null ) { return new JavaScriptContent( $text ); } @@ -731,7 +731,7 @@ class CssContentHandler extends TextContentHandler { parent::__construct( $modelName, array( 'text/css' ) ); } - public function unserialize( $text, $format = null ) { + public function unserializeContent( $text, $format = null ) { return new CssContent( $text ); } diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 277507f0ec..d2d5f0f158 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5830,7 +5830,7 @@ $wgNamespaceContentModels = array(); * * * 'ignore': return null * * 'fail': throw an MWException - * * 'serialize': serialize to default format + * * 'serializeContent': serializeContent to default format */ $wgContentHandlerTextFallback = 'ignore'; diff --git a/includes/WikiPage.php b/includes/WikiPage.php index dac63c9b59..54827ed22c 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -1384,7 +1384,7 @@ class WikiPage extends Page { if ( $txt !== $content_text ) { # if the text changed, unserialize the new version to create an updated Content object. - $content = $content->getContentHandler()->unserialize( $txt ); + $content = $content->getContentHandler()->unserializeContent( $txt ); } } @@ -2627,8 +2627,8 @@ class WikiPage extends Page { # NOTE: stub for backwards-compatibility. assumes the given text is wikitext. will break horribly if it isn't. $handler = ContentHandler::getForModelName( CONTENT_MODEL_WIKITEXT ); - $oldContent = $oldtext ? $handler->unserialize( $oldtext ) : null; - $newContent = $newtext ? $handler->unserialize( $newtext ) : null; + $oldContent = $oldtext ? $handler->unserializeContent( $oldtext ) : null; + $newContent = $newtext ? $handler->unserializeContent( $newtext ) : null; return $handler->getAutosummary( $oldContent, $newContent, $flags ); } -- 2.20.1