MaintenanceShell provides access to the Maintenance scripts via a Special Page.
Maintenance scripts are powerful tools which can have a significant impact on your wiki. Many of them require users to have access to the file system. Do not grant rights to the MaintenanceShell lightly.
Contents |
The default working directory for the maintenance scripts is yourwikidir/maintenance/ . You may override this value using $wgMaintenanceShellDir.
# Default settings $wgMaintenanceShellDir = "$IP/maintenance/";
You may also use the magic word {{ROOT}} in the command line area. It will be replaced with the full path to the root folder of the web server.
Default folder of the MaintenanceShell script:
{{ROOT}}/w/extensions/MaintenanceShell/
To install this extension:
# Sysops will have access to the MaintenanceShell $wgGroupPermissions['sysop']['maintenanceshell'] = true; #Place this on the VERY LAST line of your Localsettings.php file: require_once("$IP/extensions/MaintenanceShell/MaintenanceShell.php");
Note: The require_once line MUST be the last line of your Localsettings.php to ensure all settings are loaded when the MaintenanceShell is run.
MaintenanceShell adds a new user right called maintenanceshell, which a user must be granted before they can access the MaintenanceShell page. You may add the right to an existing group, or assign it to a new group and add users to that group. Place the following code in LocalSettings.php:
Existing group:
$wgGroupPermissions['sysop']['maintenanceshell'] = true;
New user group:
$wgGroupPermissions['maintainer']['maintenanceshell'] = true;
MaintenanceShell tricks maintenance scripts into thinking they are running from the command line instead of a web server. There may be unexpected results due to this fact -- however, all scripts tested so far are working normally. Please report any unexpected results on talk page.
commandLine.inc is provided with your Mediawiki installation. Depending on your error settings you may see some warning and notice messages emited from commandLine.inc when you run scripts using MaintenanceShell. You can edit commandLine.inc in two places to hide these errors.
Change
define('MEDIAWIKI',true);
To
@ define('MEDIAWIKI',true);
Change
if ( file_exists ....
To
if ( @ file_exists ....