MediaWiki REL1_33
LocalisationUpdate\Updater Class Reference

Executes the localisation update. More...

Public Member Functions

 execute (Finder $finder, ReaderFactory $readerFactory, FetcherFactory $fetcherFactory, array $repos, $logger)
 
 expandRemotePath ( $info, $repos)
 Expands repository relative path to full url with the given repository patterns.
 
 fetchFiles (FetcherFactory $factory, $path)
 Fetches files from given Url pattern.
 
 findChangedTranslations ( $origin, $remote, $blacklist=[])
 Find new and changed translations in $remote and returns them.
 
 isDirectory ( $path)
 Whether the path is a pattern and thus we need to use appropriate code for fetching directories.
 
 readMessages (ReaderFactory $readerFactory, array $files)
 Parses translations from given list of files.
 

Detailed Description

Executes the localisation update.

Definition at line 13 of file Updater.php.

Member Function Documentation

◆ execute()

LocalisationUpdate\Updater::execute ( Finder $finder,
ReaderFactory $readerFactory,
FetcherFactory $fetcherFactory,
array $repos,
$logger )

Definition at line 126 of file Updater.php.

References $e, and and().

◆ expandRemotePath()

LocalisationUpdate\Updater::expandRemotePath ( $info,
$repos )

Expands repository relative path to full url with the given repository patterns.

Extra variables in $info are used as variables and will be replaced the pattern.

Parameters
array$infoComponent information.
array$reposRepository information.
Returns
string

Definition at line 35 of file Updater.php.

References $keys, and and().

◆ fetchFiles()

LocalisationUpdate\Updater::fetchFiles ( FetcherFactory $factory,
$path )

Fetches files from given Url pattern.

Parameters
FetcherFactory$factoryFactory to construct fetchers.
string$pathUrl to the file or pattern of files.
Returns
array List of Urls with file contents as path.

Definition at line 113 of file Updater.php.

References and(), and LocalisationUpdate\FetcherFactory\getFetcher().

◆ findChangedTranslations()

LocalisationUpdate\Updater::findChangedTranslations ( $origin,
$remote,
$blacklist = [] )

Find new and changed translations in $remote and returns them.

Parameters
array$origin
array$remote
array$blacklistArray of message keys to ignore, keys as as array keys.
Returns
array

Definition at line 92 of file Updater.php.

References $value, and and().

◆ isDirectory()

LocalisationUpdate\Updater::isDirectory ( $path)

Whether the path is a pattern and thus we need to use appropriate code for fetching directories.

Parameters
string$pathUrl
Returns
bool

Definition at line 21 of file Updater.php.

References and().

◆ readMessages()

LocalisationUpdate\Updater::readMessages ( ReaderFactory $readerFactory,
array $files )

Parses translations from given list of files.

Parameters
ReaderFactory$readerFactoryFactory to construct parsers.
array$filesList of files with their contents as array values.
Returns
array List of translations indexed by language code.

Definition at line 57 of file Updater.php.

References $code, $e, $messages, and and().


The documentation for this class was generated from the following file: