X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fshell.php;h=f5ebc025ee96e9b9ee16cb2f4fecf9a5824832a9;hb=ddef82758db4144f716431e04387d96de617135d;hp=75b2e22ce91ae930a3df01dc98c60645f4f7a5dd;hpb=fc5dced1ce8151b0354e0efda28a7542713f9cbe;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/shell.php b/maintenance/shell.php index 75b2e22ce9..f5ebc025ee 100644 --- a/maintenance/shell.php +++ b/maintenance/shell.php @@ -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(); @@ -89,12 +93,12 @@ class MediaWikiShell extends Maintenance { } if ( $d > 1 ) { # Set DBO_DEBUG (equivalent of $wgDebugDumpSql) - wfGetDB( DB_MASTER )->setFlag( DBO_DEBUG ); - wfGetDB( DB_REPLICA )->setFlag( DBO_DEBUG ); + $this->getDB( DB_MASTER )->setFlag( DBO_DEBUG ); + $this->getDB( DB_REPLICA )->setFlag( DBO_DEBUG ); } } } -$maintClass = 'MediaWikiShell'; +$maintClass = MediaWikiShell::class; require_once RUN_MAINTENANCE_IF_MAIN;