MediaWiki REL1_31
ReaderFactory.php
Go to the documentation of this file.
1<?php
8namespace LocalisationUpdate;
9
20 public function getReader( $filename ) {
21 if ( preg_match( '/i18n\.php$/', $filename ) ) {
22 return new PHPReader();
23 }
24
25 // Ugly hack for core i18n files
26 if ( preg_match( '/Messages(.*)\.php$/', $filename ) ) {
27 $code = \Language::getCodeFromFileName( basename( $filename ), 'Messages' );
28 return new PHPReader( $code );
29 }
30
31 if ( preg_match( '/\.json/', $filename ) ) {
32 $code = basename( $filename, '.json' );
33 return new JSONReader( $code );
34 }
35
36 throw new \Exception( "Unknown file format: " . $filename );
37 }
38}
Reads MediaWiki JSON i18n files.
Constructs readers for files based on the names.
getReader( $filename)
Constructs a suitable reader for a given path.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Definition hooks.txt:865