3 * JSON Schema Content Handler
7 * @author Ori Livneh <ori@wikimedia.org>
8 * @author Kunal Mehta <legoktm@gmail.com>
11 class JSONContentHandler
extends TextContentHandler
{
13 public function __construct( $modelId = CONTENT_MODEL_JSON
) {
14 parent
::__construct( $modelId, array( CONTENT_FORMAT_JSON
) );
18 * Unserializes a JSONContent object.
20 * @param string $text Serialized form of the content
21 * @param null|string $format The format used for serialization
25 public function unserializeContent( $text, $format = null ) {
26 $this->checkFormat( $format );
27 return new JSONContent( $text );
31 * Creates an empty JSONContent object.
35 public function makeEmptyContent() {
36 return new JSONContent( '' );
39 /** JSON is English **/
40 public function getPageLanguage( Title
$title, Content
$content = null ) {
41 return wfGetLangObj( 'en' );
44 /** JSON is English **/
45 public function getPageViewLanguage( Title
$title, Content
$content = null ) {
46 return wfGetLangObj( 'en' );