MediaWiki  1.34.4
CodeContentHandler.php
Go to the documentation of this file.
1 <?php
29 abstract class CodeContentHandler extends TextContentHandler {
30 
41  public function getPageLanguage( Title $title, Content $content = null ) {
42  return Language::factory( 'en' );
43  }
44 
55  public function getPageViewLanguage( Title $title, Content $content = null ) {
56  return Language::factory( 'en' );
57  }
58 
63  protected function getContentClass() {
64  throw new MWException( 'Subclass must override' );
65  }
66 
67 }
CodeContentHandler
Content handler for code content such as CSS, JavaScript, JSON, etc.
Definition: CodeContentHandler.php:29
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:41
$title
$title
Definition: testCompression.php:34
$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:55
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:63
Language\factory
static factory( $code)
Get a cached or new language object for a given language code.
Definition: Language.php:217