MediaWiki REL1_33
HttpFetcher.php
Go to the documentation of this file.
1<?php
8namespace LocalisationUpdate;
9
13class HttpFetcher implements Fetcher {
19 public function fetchFile( $url ) {
20 return \Http::get( $url );
21 }
22
29 public function fetchDirectory( $pattern ) {
30 $files = [];
31
32 $languages = \Language::fetchLanguageNames( null, 'mwfile' );
33
34 foreach ( array_keys( $languages ) as $code ) {
35 // Hack for core
36 if ( strpos( $pattern, 'Messages*.php' ) !== false ) {
37 $code = ucfirst( strtr( $code, '-', '_' ) );
38 }
39
40 $url = str_replace( '*', $code, $pattern );
41 $file = $this->fetchFile( $url );
42 if ( $file ) {
43 $files[$url] = $file;
44 }
45 }
46
47 return $files;
48 }
49}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Fetches files over HTTP(s).
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 When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password 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:856
Interface for classes which fetch files over different protocols and ways.
Definition Fetcher.php:13
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Definition router.php:42
switch( $options['output']) $languages
Definition transstat.php:76