1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 04:30:56 +02:00

Implement proper update process

If the version in the settings table mismatches the code version, then we return a 503 error for all requests coming through index.php and api.php, while admin.php serves up a form prompting for the database password which will run outstanding migrations.
This commit is contained in:
Toby Zerner
2015-10-19 15:09:54 +10:30
parent ddfedcb4dd
commit 1242fa79af
14 changed files with 290 additions and 55 deletions

View File

@@ -12,8 +12,7 @@ namespace Flarum\Install\Controller;
use Flarum\Http\Controller\ControllerInterface;
use Psr\Http\Message\ServerRequestInterface as Request;
use Zend\Diactoros\Response\EmptyResponse;
use Zend\Diactoros\Response\JsonResponse;
use Zend\Diactoros\Response\HtmlResponse;
use Zend\Diactoros\Response;
use Flarum\Install\Console\InstallCommand;
use Flarum\Install\Console\DefaultsDataProvider;
@@ -85,9 +84,7 @@ class InstallController implements ControllerInterface
try {
$this->command->run($input, $output);
} catch (Exception $e) {
return new JsonResponse([
'error' => $e->getMessage()
], 500);
return new HtmlResponse($e->getMessage(), 500);
}
$token = $this->bus->dispatch(