Flarum\Update\Controller\UpdateController::handle PHP Method

handle() public method

public handle ( Psr\Http\Message\ServerRequestInterface $request ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
return Psr\Http\Message\ResponseInterface
    public function handle(Request $request)
    {
        $input = $request->getParsedBody();
        if (array_get($input, 'databasePassword') !== $this->app->config('database.password')) {
            return new HtmlResponse('Incorrect database password.', 500);
        }
        $body = fopen('php://temp', 'wb+');
        $input = new StringInput('');
        $output = new StreamOutput($body);
        try {
            $this->command->run($input, $output);
        } catch (Exception $e) {
            return new HtmlResponse($e->getMessage(), 500);
        }
        return new Response($body, 200);
    }
UpdateController