Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
__bootstrap.php
1<?php
2declare( strict_types = 1 );
3
4/*
5 * Boilerpate code for bootstrapping maintenance scripts.
6 *
7 * This code must be in global scope. Callers must define $class;
8 */
9$env = getenv( 'MW_INSTALL_PATH' );
10$IP = $env !== false ? $env : __DIR__ . '/../../..';
11require_once "$IP/maintenance/Maintenance.php";
12// Manually load required classes, as autoloader is not available until RUN_MAINTENANCE_IF_MAIN
13require_once __DIR__ . '/../src/Utilities/BaseMaintenanceScript.php';
14// $maintClass must be after Maintenance.php
15// @phan-suppress-next-line PhanUndeclaredGlobalVariable
16$maintClass = $class;
17$file = strtr( $maintClass, [ 'MediaWiki\\Extension\\Translate\\' => '', '\\' => '/' ] );
18require_once __DIR__ . "/../src/$file.php";
19require_once RUN_MAINTENANCE_IF_MAIN;