MediaWiki
1.34.0
HttpFetcher.php
Go to the documentation of this file.
1
<?php
8
namespace
LocalisationUpdate
;
9
13
class
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
$url = str_replace(
'*'
, $code, $pattern );
36
$file
= $this->fetchFile( $url );
37
if
(
$file
) {
38
$files[$url] =
$file
;
39
}
40
}
41
42
return
$files;
43
}
44
}
$languages
switch( $options['output']) $languages
Definition:
transstat.php:76
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition:
router.php:42
LocalisationUpdate\HttpFetcher\fetchDirectory
fetchDirectory( $pattern)
This is horribly inefficient.
Definition:
HttpFetcher.php:29
LocalisationUpdate\HttpFetcher
Fetches files over HTTP(s).
Definition:
HttpFetcher.php:13
LocalisationUpdate
Definition:
Fetcher.php:8
LocalisationUpdate\Fetcher
Interface for classes which fetch files over different protocols and ways.
Definition:
Fetcher.php:13
LocalisationUpdate\HttpFetcher\fetchFile
fetchFile( $url)
Definition:
HttpFetcher.php:19
Language\fetchLanguageNames
static fetchLanguageNames( $inLanguage=self::AS_AUTONYMS, $include='mw')
Get an array of language names, indexed by code.
Definition:
Language.php:818
extensions
LocalisationUpdate
includes
fetcher
HttpFetcher.php
Generated on Thu Dec 19 2019 14:53:54 for MediaWiki by
1.8.16