Properly deprecate srprop=score|hasrelated
[mediawiki.git] / includes / content / JSONContentHandler.php
blobb0b7aaea48d2617c56c97b519809cf0db2b0f0c8
1 <?php
2 /**
3 * JSON Schema Content Handler
5 * @file
7 * @author Ori Livneh <ori@wikimedia.org>
8 * @author Kunal Mehta <legoktm@gmail.com>
9 */
11 /**
12 * @since 1.24
14 class JSONContentHandler extends TextContentHandler {
16 public function __construct( $modelId = CONTENT_MODEL_JSON ) {
17 parent::__construct( $modelId, array( CONTENT_FORMAT_JSON ) );
20 /**
21 * @return string
23 protected function getContentClass() {
24 return 'JSONContent';
27 /**
28 * Returns the english language, because JSON is english, and should be handled as such.
30 * @param Title $title
31 * @param Content|null $content
33 * @return Language Return of wfGetLangObj( 'en' )
35 * @see ContentHandler::getPageLanguage()
37 public function getPageLanguage( Title $title, Content $content = null ) {
38 return wfGetLangObj( 'en' );
41 /**
42 * Returns the english language, because JSON is english, and should be handled as such.
44 * @param Title $title
45 * @param Content|null $content
47 * @return Language Return of wfGetLangObj( 'en' )
49 * @see ContentHandler::getPageLanguage()
51 public function getPageViewLanguage( Title $title, Content $content = null ) {
52 return wfGetLangObj( 'en' );