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
38 // Define a function, since we can't put a closure or object
39 // reference into MW_FINAL_SETUP_CALLBACK.
40 function wfMaintenanceRunSetup( SettingsBuilder $settingsBuilder ) {
41 global $runner;
42 $runner->setup( $settingsBuilder );
43 }
44
45 define( 'MW_FINAL_SETUP_CALLBACK', 'wfMaintenanceRunSetup' );
46}
47
48// Initialize MediaWiki (load settings, extensions, etc).
49require_once "$IP/includes/Setup.php";
50
52
53// Exit with an error status if execute() returned false
54if ( !$success ) {
55 exit( 1 );
56}
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:51