Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| AllTrans | |
100.00% |
6 / 6 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| execute | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Get all the translations messages, as defined in the English language file. |
| 4 | * |
| 5 | * @license GPL-2.0-or-later |
| 6 | * @file |
| 7 | * @ingroup MaintenanceLanguage |
| 8 | */ |
| 9 | |
| 10 | use MediaWiki\Maintenance\Maintenance; |
| 11 | |
| 12 | // @codeCoverageIgnoreStart |
| 13 | require_once __DIR__ . '/../Maintenance.php'; |
| 14 | // @codeCoverageIgnoreEnd |
| 15 | |
| 16 | /** |
| 17 | * Maintenance script that gets all messages as defined by the |
| 18 | * English language file. |
| 19 | * |
| 20 | * @ingroup MaintenanceLanguage |
| 21 | */ |
| 22 | class AllTrans extends Maintenance { |
| 23 | |
| 24 | public function __construct() { |
| 25 | parent::__construct(); |
| 26 | $this->addDescription( 'Get all messages as defined by the English language file' ); |
| 27 | } |
| 28 | |
| 29 | public function execute() { |
| 30 | $localisationCache = $this->getServiceContainer()->getLocalisationCache(); |
| 31 | $englishMessages = $localisationCache->getItem( 'en', 'messages' ); |
| 32 | foreach ( $englishMessages as $key => $_ ) { |
| 33 | $this->output( "$key\n" ); |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // @codeCoverageIgnoreStart |
| 39 | $maintClass = AllTrans::class; |
| 40 | require_once RUN_MAINTENANCE_IF_MAIN; |
| 41 | // @codeCoverageIgnoreEnd |