protected function checkBasicRequirementsAndDisplayLoadingScreen()
    {
        $messageRenderer = new MessageRenderer($this->bootstrap);
        $basicRequirements = new BasicRequirements();
        $result = $basicRequirements->findError();
        if ($result instanceof Error) {
            $messageRenderer->showMessages([$result]);

            return;
        }

        $phpBinaryDetectionMessage = $this->checkAndSetPhpBinaryIfNeeded();
        if ($phpBinaryDetectionMessage instanceof Error) {
            $messageRenderer->showMessages([$phpBinaryDetectionMessage]);

            return;
        }

        $currentUri = substr($this->request->getUri(), strlen($this->request->getBaseUri()));
        if ($currentUri === 'setup' || $currentUri === 'setup/') {
            $redirectUri = ($currentUri === 'setup/' ? 'index' : 'setup/index');
            $messages = [new Message('We are now redirecting you to the setup. <b>This might take 10-60 seconds on the first run,</b> because the application needs to build up various caches.', null, [], 'Initialising Setup ...')];
            if ($phpBinaryDetectionMessage !== null) {
                array_unshift($messages, $phpBinaryDetectionMessage);
            }
            $messageRenderer->showMessages($messages, '<meta http-equiv="refresh" content="2;URL=\'' . $redirectUri . '\'">');
        }
    }