Go to the documentation of this file.
3 $IP = strval( getenv(
'MW_INSTALL_PATH' ) ) !==
''
4 ? getenv(
'MW_INSTALL_PATH' )
5 : realpath( __DIR__ .
'/../../' );
7 require
"$IP/maintenance/Maintenance.php";
11 parent::__construct();
12 $this->mDescription =
'Fetches translation updates to MediaWiki core, skins and extensions.';
15 'Fetch translations from repositories identified by this',
26 ini_set(
"max_execution_time", 0 );
27 ini_set(
'memory_limit', -1 );
31 global $wgLocalisationUpdateRepositories;
32 global $wgLocalisationUpdateRepository;
36 $this->
error(
"No cache directory configured",
true );
41 $messagesDirs = $lc->getMessagesDirs();
47 $repoid = $this->
getOption(
'repoid', $wgLocalisationUpdateRepository );
48 if ( !isset( $wgLocalisationUpdateRepositories[$repoid] ) ) {
49 $known = implode(
', ', array_keys( $wgLocalisationUpdateRepositories ) );
50 $this->
error(
"Unknown repoid $repoid; known: $known",
true );
53 $repos = $wgLocalisationUpdateRepositories[$repoid];
61 $updatedMessages =
$updater->execute(
70 $count = array_sum( array_map(
'count', $updatedMessages ) );
72 $this->
output(
"Found no new translations\n" );
76 foreach ( $updatedMessages
as $language =>
$messages ) {
80 $this->
output(
"Saved $count new translations\n" );
84 $this->
output( $msg .
"\n" );
__construct()
Default constructor.
require_once RUN_MAINTENANCE_IF_MAIN
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Constructs fetchers based on the repository urls.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static getLocalisationCache()
Get the LocalisationCache instance.
Executes the localisation update.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
requireExtension( $name)
Indicate that the specified extension must be loaded before the script can run.
static getFilename( $language)
Returns a filename where updated translations are stored.
Constructs readers for files based on the names.
static getDirectory()
Returns a directory where updated translations are stored.
getOption( $name, $default=null)
Get an option, or return the default.
$wgExtensionMessagesFiles['ExtensionNameMagic']
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
$page->newPageUpdater($user) $updater
error( $err, $die=0)
Throw an error to the user.
output( $out, $channel=null)
Throw some output to the user.
execute()
Do the actual work.
Interface for classes which provide list of components, which should be included for l10n updates.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class