X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=maintenance%2Fshell.php;h=a67417fc09c166f7be5dcdafacf26717b1451886;hb=44b66843e928e94b4ea8dea60ecde62ba7ec8d61;hp=65c353a29e18b74a5d607e4d982b8b2498a26bce;hpb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/shell.php b/maintenance/shell.php index 65c353a29e..a67417fc09 100644 --- a/maintenance/shell.php +++ b/maintenance/shell.php @@ -58,7 +58,7 @@ class MediaWikiShell extends Maintenance { public function execute() { if ( !class_exists( \Psy\Shell::class ) ) { - $this->error( 'PsySH not found. Please run composer with the --dev option.', 1 ); + $this->fatalError( 'PsySH not found. Please run composer with the --dev option.' ); } $traverser = new \PhpParser\NodeTraverser(); @@ -67,8 +67,12 @@ class MediaWikiShell extends Maintenance { // add this after initializing the code cleaner so all the default passes get added first $traverser->addVisitor( new CodeCleanerGlobalsPass() ); - $config = new \Psy\Configuration( [ 'codeCleaner' => $codeCleaner ] ); + $config = new \Psy\Configuration(); + $config->setCodeCleaner( $codeCleaner ); $config->setUpdateCheck( \Psy\VersionUpdater\Checker::NEVER ); + // prevent https://github.com/bobthecow/psysh/issues/443 when using sudo -E + $config->setRuntimeDir( wfTempDir() ); + $shell = new \Psy\Shell( $config ); if ( $this->hasOption( 'd' ) ) { $this->setupLegacy(); @@ -96,5 +100,5 @@ class MediaWikiShell extends Maintenance { } -$maintClass = 'MediaWikiShell'; +$maintClass = MediaWikiShell::class; require_once RUN_MAINTENANCE_IF_MAIN;