if ( $count < 2 ) {
return false; // sanity
}
- if ( $bt[0]['class'] !== 'Maintenance' || $bt[0]['function'] !== 'shouldExecute' ) {
+ if ( $bt[0]['class'] !== self::class || $bt[0]['function'] !== 'shouldExecute' ) {
return false; // last call should be to this function
}
$includeFuncs = [ 'require_once', 'require', 'include', 'include_once' ];
$this->fatalError( $err, intval( $die ) );
}
$this->outputChanneled( false );
- if ( PHP_SAPI == 'cli' ) {
+ if ( PHP_SAPI == 'cli' || PHP_SAPI == 'phpdbg' ) {
fwrite( STDERR, $err . "\n" );
} else {
print $err;
global $IP, $wgCommandLineMode, $wgRequestTime;
# Abort if called from a web server
- if ( PHP_SAPI !== 'cli' ) {
+ # wfIsCLI() is not available yet
+ if ( PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg' ) {
$this->fatalError( 'This script must be run from the command line' );
}