MediaWiki  master
CodeContentHandler.php
Go to the documentation of this file.
1 <?php
25 
31 abstract class CodeContentHandler extends TextContentHandler {
32 
43  public function getPageLanguage( Title $title, Content $content = null ) {
44  return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
45  }
46 
57  public function getPageViewLanguage( Title $title, Content $content = null ) {
58  return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
59  }
60 
65  protected function getContentClass() {
66  throw new MWException( 'Subclass must override' );
67  }
68 
69 }
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:130
CodeContentHandler
Content handler for code content such as CSS, JavaScript, JSON, etc.
Definition: CodeContentHandler.php:31
MWException
MediaWiki exception.
Definition: MWException.php:26
CodeContentHandler\getPageLanguage
getPageLanguage(Title $title, Content $content=null)
Returns the English language, because code is English, and should be handled as such.
Definition: CodeContentHandler.php:43
$title
$title
Definition: testCompression.php:36
$content
$content
Definition: router.php:78
TextContentHandler
Base content handler implementation for flat text contents.
Definition: TextContentHandler.php:31
CodeContentHandler\getPageViewLanguage
getPageViewLanguage(Title $title, Content $content=null)
Returns the English language, because code is English, and should be handled as such.
Definition: CodeContentHandler.php:57
Content
Base interface for content objects.
Definition: Content.php:34
Title
Represents a title within MediaWiki.
Definition: Title.php:42
CodeContentHandler\getContentClass
getContentClass()
Definition: CodeContentHandler.php:65