Merge "Make the PHP code snippet in SkinFallbackTemplate explicitly ltr"
[mediawiki.git] / includes / content / JSONContentHandler.php
blob33f203661cf6f868fbe8b6ff210484c1bf1ac8e4
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 /**
17 * The class name of objects that should be created
19 * @deprecated override getContentClass instead
21 * @var string
23 protected $contentClass = 'JSONContent';
25 public function __construct( $modelId = CONTENT_MODEL_JSON ) {
26 parent::__construct( $modelId, array( CONTENT_FORMAT_JSON ) );
29 /**
30 * Temporary back-compat until extensions
31 * are updated to override this
33 * @return string
35 protected function getContentClass() {
36 return $this->contentClass;
39 /**
40 * Returns the english language, because JSON is english, and should be handled as such.
42 * @param Title $title
43 * @param Content|null $content
45 * @return Language Return of wfGetLangObj( 'en' )
47 * @see ContentHandler::getPageLanguage()
49 public function getPageLanguage( Title $title, Content $content = null ) {
50 return wfGetLangObj( 'en' );
53 /**
54 * Returns the english language, because JSON is english, and should be handled as such.
56 * @param Title $title
57 * @param Content|null $content
59 * @return Language Return of wfGetLangObj( 'en' )
61 * @see ContentHandler::getPageLanguage()
63 public function getPageViewLanguage( Title $title, Content $content = null ) {
64 return wfGetLangObj( 'en' );