MediaWiki  1.34.0
ReaderFactory.php
Go to the documentation of this file.
1 <?php
8 namespace LocalisationUpdate;
9 
20  public function getReader( $filename ) {
21  if ( preg_match( '/\.json/', $filename ) ) {
22  $code = basename( $filename, '.json' );
23  return new JSONReader( $code );
24  }
25 
26  throw new \Exception( "Unknown file format: " . $filename );
27  }
28 }
LocalisationUpdate\JSONReader
Reads MediaWiki JSON i18n files.
Definition: JSONReader.php:13
LocalisationUpdate
Definition: Fetcher.php:8
LocalisationUpdate\ReaderFactory
Constructs readers for files based on the names.
Definition: ReaderFactory.php:13
LocalisationUpdate\ReaderFactory\getReader
getReader( $filename)
Constructs a suitable reader for a given path.
Definition: ReaderFactory.php:20