MediaWiki master
run.php
Go to the documentation of this file.
1<?php
2
12
13// No AutoLoader yet
14require_once __DIR__ . '/Maintenance.php';
15require_once __DIR__ . '/includes/MaintenanceRunner.php';
16require_once __DIR__ . '/includes/MaintenanceParameters.php';
17
18// Not in file scope, abort!
19if ( !MaintenanceRunner::shouldExecute() ) {
20 return;
21}
22
23// Define the MediaWiki entrypoint
24define( 'MEDIAWIKI', true );
25
27require_once "$IP/includes/AutoLoader.php";
28
29// phpcs:disable: MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix
31$runner->initFromWrapper( $argv );
32
33$runner->defineSettings();
34
35// Custom setup for Maintenance entry point
36if ( !defined( 'MW_FINAL_SETUP_CALLBACK' ) ) {
37
42 function wfMaintenanceRunSetup( SettingsBuilder $settingsBuilder ) {
43 global $runner;
44 $runner->setup( $settingsBuilder );
45 }
46
47 // Do not use first-class callable here, to make the file compatible with older php syntax
48 define( 'MW_FINAL_SETUP_CALLBACK', 'wfMaintenanceRunSetup' );
49}
50
51// Initialize MediaWiki (load settings, extensions, etc).
52require_once "$IP/includes/Setup.php";
53
55
56// Exit with an error status if execute() returned false
57if ( !$success ) {
58 exit( 1 );
59}
wfDetectInstallPath()
Decide and remember where mediawiki is installed.
A runner for maintenance scripts.
Builder class for constructing a Config object from a set of sources during bootstrap.
$IP
Definition run.php:26
$runner
Definition run.php:30
$success
Definition run.php:54