MediaWiki  1.23.1
doMaintenance.php
Go to the documentation of this file.
1 <?php
29 if ( !defined( 'RUN_MAINTENANCE_IF_MAIN' ) ) {
30  echo "This file must be included after Maintenance.php\n";
31  exit( 1 );
32 }
33 
34 // Wasn't included from the file scope, halt execution (probably wanted the class)
35 // If a class is using commandLine.inc (old school maintenance), they definitely
36 // cannot be included and will proceed with execution
37 if ( !Maintenance::shouldExecute() && $maintClass != 'CommandLineInc' ) {
38  return;
39 }
40 
41 if ( !$maintClass || !class_exists( $maintClass ) ) {
42  echo "\$maintClass is not set or is set to a non-existent class.\n";
43  exit( 1 );
44 }
45 
46 // Get an object to start us off
48 
49 // Basic sanity checks and such
51 
52 // We used to call this variable $self, but it was moved
53 // to $maintenance->mSelf. Keep that here for b/c
55 
56 # Start the autoloader, so that extensions can derive classes from core files
57 require_once "$IP/includes/AutoLoader.php";
58 # Stub the profiler
59 require_once "$IP/includes/profiler/Profiler.php";
60 
61 # Start the profiler
63 if ( file_exists( "$IP/StartProfiler.php" ) ) {
64  require "$IP/StartProfiler.php";
65 }
66 
67 // Some other requires
68 require_once "$IP/includes/Defines.php";
69 require_once "$IP/includes/DefaultSettings.php";
70 
71 # Load composer's autoloader if present
72 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
73  require_once "$IP/vendor/autoload.php";
74 }
75 
76 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
77  # Use a callback function to configure MediaWiki
78  call_user_func( MW_CONFIG_CALLBACK );
79 } else {
80  if ( file_exists( "$IP/../wmf-config/wikimedia-mode" ) ) {
81  // Load settings, using wikimedia-mode if needed
82  // @todo FIXME: Replace this hack with general farm-friendly code
83  # @todo FIXME: Wikimedia-specific stuff needs to go away to an ext
84  # Maybe a hook?
85  global $cluster;
86  $cluster = 'pmtpa';
87  require "$IP/../wmf-config/wgConf.php";
88  }
89  // Require the configuration (probably LocalSettings.php)
90  require $maintenance->loadSettings();
91 }
92 
94  if ( $wgLocalisationCacheConf['storeClass'] === false && ( $wgLocalisationCacheConf['store'] == 'db' || ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) ) ) {
95  $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
96  }
97 }
99 // Some last includes
100 require_once "$IP/includes/Setup.php";
101 
102 // Do the work
103 try {
105 
106  // Potentially debug globals
108 
109  // Perform deferred updates.
110  DeferredUpdates::doUpdates( 'commit' );
111 
112  // log profiling info
114 
115  // Commit and close up!
117  $factory->commitMasterChanges();
118  $factory->shutdown();
119 } catch ( MWException $mwe ) {
120  echo $mwe->getText();
121  exit( 1 );
122 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK(!function_exists( 'version_compare')||(version_compare(phpversion(), '5.3.2')< 0))
Definition: install.php:29
Maintenance\getDbType
getDbType()
Does the script need different DB access? By default, we give Maintenance scripts normal rights to th...
Definition: Maintenance.php:399
Maintenance\setup
setup()
Do some sanity checking and basic setup.
Definition: Maintenance.php:469
Maintenance\getName
getName()
Get the script's name.
Definition: Maintenance.php:276
DeferredUpdates\doUpdates
static doUpdates( $commit='')
Do any deferred updates and clear the list.
Definition: DeferredUpdates.php:82
$maintClass
$maintClass
Definition: attachLatest.php:91
Maintenance\finalSetup
finalSetup()
Handle some last-minute setup here.
Definition: Maintenance.php:825
MWException
MediaWiki exception.
Definition: MWException.php:26
MWException\getText
getText()
Get the text to display when reporting the error on the command line.
Definition: MWException.php:158
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Maintenance\globals
globals()
Potentially debug globals.
Definition: Maintenance.php:900
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
Maintenance\shouldExecute
static shouldExecute()
Should we execute the maintenance script, or just allow it to be included as a standalone class?...
Definition: Maintenance.php:136
Maintenance\DB_NONE
const DB_NONE
Constants for DB access type.
Definition: Maintenance.php:57
Maintenance\loadSettings
loadSettings()
Generic setup for most installs.
Definition: Maintenance.php:910
CommandLineInc\execute
execute()
Do the actual work.
Definition: commandLine.inc:50
$self
$self
Definition: doMaintenance.php:54
wfGetLBFactory
& wfGetLBFactory()
Get the load balancer factory object.
Definition: GlobalFunctions.php:3669
$wgProfiler
$wgProfiler
Definition: doMaintenance.php:62
$maintenance
if(!defined( 'RUN_MAINTENANCE_IF_MAIN')) if(!Maintenance::shouldExecute() && $maintClass !='CommandLineInc') if(! $maintClass||!class_exists( $maintClass)) $maintenance
Definition: doMaintenance.php:47
$factory
$factory
Definition: doMaintenance.php:116
wfLogProfilingData
wfLogProfilingData()
Definition: GlobalFunctions.php:1226