MediaWiki master
CodeContentHandler.php
Go to the documentation of this file.
1<?php
26
34abstract class CodeContentHandler extends TextContentHandler {
35
48 public function getPageLanguage( Title $title, Content $content = null ) {
49 return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
50 }
51
64 public function getPageViewLanguage( Title $title, Content $content = null ) {
65 return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
66 }
67
69 protected function getContentClass() {
70 throw new LogicException( 'Subclass must override' );
71 }
72
73}
Content handler for code content such as CSS, JavaScript, JSON, etc.
getPageViewLanguage(Title $title, Content $content=null)
Returns the English language, because code is English, and should be handled as such.
getContentClass()
Returns the name of the associated Content class, to be used when creating new objects....
getPageLanguage(Title $title, Content $content=null)
Returns the English language, because code is English, and should be handled as such.
Service locator for MediaWiki core services.
Represents a title within MediaWiki.
Definition Title.php:78
Base content handler implementation for flat text contents.
Base interface for representing page content.
Definition Content.php:37