MediaWiki REL1_30
HttpFetcher.php
Go to the documentation of this file.
1<?php
8namespace LocalisationUpdate;
9
13class HttpFetcher implements Fetcher {
14 public function fetchFile( $url ) {
15 return \Http::get( $url );
16 }
17
22 public function fetchDirectory( $pattern ) {
23 $files = [];
24
25 $languages = \Language::fetchLanguageNames( null, 'mwfile' );
26
27 foreach ( array_keys( $languages ) as $code ) {
28 // Hack for core
29 if ( strpos( $pattern, 'Messages*.php' ) !== false ) {
30 $code = ucfirst( strtr( $code, '-', '_' ) );
31 }
32
33 $url = str_replace( '*', $code, $pattern );
34 $file = $this->fetchFile( $url );
35 if ( $file ) {
36 $files[$url] = $file;
37 }
38 }
39
40 return $files;
41 }
42}
Fetches files over HTTP(s).
fetchFile( $url)
Fetches a single resource.
fetchDirectory( $pattern)
This is horribly inefficient.
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:863
Interface for classes which fetch files over different protocols and ways.
Definition Fetcher.php:13
switch( $options['output']) $languages
Definition transstat.php:76