diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index 9d240a5045..35a10c21dd 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -31,7 +31,13 @@ return call_user_func(function($environment = PhraseaApplication::ENV_PROD) { $app->before(function (Request $request) use ($app) { if (0 === strpos($request->getPathInfo(), '/setup')) { - if (!$app['phraseanet.configuration-tester']->isBlank()) { + if (!$app['phraseanet.configuration-tester']->isInstalled()) { + if (!$app['phraseanet.configuration-tester']->isBlank()) { + if ('setup_upgrade_instructions' !== $app['request']->attributes->get('_route')) { + return $app->redirectPath('setup_upgrade_instructions'); + } + } + } elseif (!$app['phraseanet.configuration-tester']->isBlank()) { return $app->redirectPath('homepage'); } } else { diff --git a/lib/Alchemy/Phrasea/Controller/Setup.php b/lib/Alchemy/Phrasea/Controller/Setup.php index 896e7de61b..ff17e751f1 100644 --- a/lib/Alchemy/Phrasea/Controller/Setup.php +++ b/lib/Alchemy/Phrasea/Controller/Setup.php @@ -37,6 +37,9 @@ class Setup implements ControllerProviderInterface $controllers->get('/installer/', 'controller.setup:rootInstaller') ->bind('install_root'); + $controllers->get('/upgrade-instructions/', 'controller.setup:displayUpgradeInstructions') + ->bind('setup_upgrade_instructions'); + $controllers->get('/installer/step2/', 'controller.setup:getInstallForm') ->bind('install_step2'); @@ -70,6 +73,14 @@ class Setup implements ControllerProviderInterface ); } + public function displayUpgradeInstructions(Application $app, Request $request) + { + return $app['twig']->render('/setup/upgrade-instructions.html.twig', array( + 'locale' => $app['locale'], + 'available_locales' => Application::getAvailableLanguages(), + )); + } + public function getInstallForm(Application $app, Request $request) { $warnings = array(); diff --git a/templates/web/setup/upgrade-instructions.html.twig b/templates/web/setup/upgrade-instructions.html.twig new file mode 100644 index 0000000000..ffd11658da --- /dev/null +++ b/templates/web/setup/upgrade-instructions.html.twig @@ -0,0 +1,38 @@ +{% extends '/setup/wrapper.html.twig' %} + +{% block content %} +
+
+
+ + Upgrade Instructions +++ This Phraseanet install requires an upgrade. + +
+
+
|
+