From: Tim Düsterhus Date: Wed, 7 Dec 2022 15:26:42 +0000 (+0100) Subject: Skip selectSetupLanguage() and showLicense() in developer mode by using gotoNextStep() X-Git-Tag: 6.0.0_Alpha_1~635 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=16ac5e9aa3caedc1d1a26d87966b9391a9bdd5eb;p=GitHub%2FWoltLab%2FWCF.git Skip selectSetupLanguage() and showLicense() in developer mode by using gotoNextStep() While this adds additional HTTP requests, it cleans up the dispatcher, specifically getting rid of the fall-through logic, making the setup cleaner with negligible performance loss. --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 9faed51996..922fb14052 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -222,29 +222,19 @@ final class WCFSetup extends WCF // execute current step switch ($step) { case 'selectSetupLanguage': - if (!self::$developerMode) { - $this->calcProgress(0); + $this->calcProgress(0); - return $this->selectSetupLanguage(); - } + return $this->selectSetupLanguage(); - // no break case 'showLicense': - if (!self::$developerMode) { - $this->calcProgress(1); + $this->calcProgress(1); - return $this->showLicense(); - } + return $this->showLicense(); - // no break case 'showSystemRequirements': - if (!self::$developerMode) { - $this->calcProgress(2); - - return $this->showSystemRequirements(); - } + $this->calcProgress(2); - // no break + return $this->showSystemRequirements(); case 'configureDB': $this->calcProgress(3); @@ -288,6 +278,10 @@ final class WCFSetup extends WCF */ protected function selectSetupLanguage(): ResponseInterface { + if (self::$developerMode) { + return $this->gotoNextStep('showLicense'); + } + return new HtmlResponse( WCF::getTPL()->fetchStream( 'stepSelectSetupLanguage', @@ -305,6 +299,10 @@ final class WCFSetup extends WCF */ protected function showLicense(): ResponseInterface { + if (self::$developerMode) { + return $this->gotoNextStep('showSystemRequirements'); + } + $missingAcception = false; if (isset($_POST['send'])) {