* is the execute() method. See docs/maintenance.txt for more info
* and a quick demo of how to use it.
*
- * @author Chad Horohoe <chad@anyonecanedit.org>
* @since 1.16
* @ingroup Maintenance
*/
"http://en.wikipedia.org. This is sometimes necessary because " .
"server name detection may fail in command line scripts.", false, true );
$this->addOption( 'profiler', 'Profiler output format (usually "text")', false, true );
+ // This is named --mwdebug, because --debug would conflict in the phpunit.php CLI script.
+ $this->addOption( 'mwdebug', 'Enable built-in MediaWiki development settings', false, true );
# Save generic options to display them separately in help
$this->mGenericParameters = $this->mParams;
global $IP, $wgCommandLineMode, $wgRequestTime;
# Abort if called from a web server
- if ( isset( $_SERVER ) && isset( $_SERVER['REQUEST_METHOD'] ) ) {
+ if ( PHP_SAPI !== 'cli' ) {
$this->fatalError( 'This script must be run from the command line' );
}
MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->destroy();
}
+ # Apply debug settings
+ if ( $this->hasOption( 'mwdebug' ) ) {
+ require __DIR__ . '/../includes/DevelopmentSettings.php';
+ }
+
// Per-script profiling; useful for debugging
$this->activateProfiler();