Collapse some unnecessary else conditions
[lhc/web/wiklou.git] / maintenance / shell.php
index 75b2e22..a67417f 100644 (file)
@@ -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;