diff --git a/config/nginx.rewrite.rules b/config/nginx.rewrite.rules index b5a1d65869..69639e0e06 100644 --- a/config/nginx.rewrite.rules +++ b/config/nginx.rewrite.rules @@ -40,8 +40,8 @@ rewrite ^/prod/export/.*$ /index.php last; rewrite ^/prod/record/preview/.*$ /index.php last; rewrite ^/prod/notifications/.*$ /index.php last; rewrite ^/prod/share/.*$ /index.php last; -rewrite ^/setup/$ /index.php last; rewrite ^/setup/.*$ /index.php last; +rewrite ^/setup/$ /index.php last; rewrite ^/user/preferences/.*$ /index.php last; rewrite ^/user/notifications/.*$ /index.php last; diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index f7e5475a04..df707763a5 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -24,7 +24,7 @@ return call_user_func(function($environment = null) { $app->before(function (Request $request) use ($app) { if (0 === strpos($request->getPathInfo(), '/setup')) { if (!$app['phraseanet.configuration-tester']->isBlank()) { - return $app->redirect('/login/'); + return $app->redirect($app->path('homepage')); } } else { $app['firewall']->requireSetup(); diff --git a/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php b/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php index c8b0d5b226..ccfcae9730 100644 --- a/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php +++ b/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php @@ -27,8 +27,7 @@ class CheckEnvironment extends Command { parent::__construct($name); - $this - ->setDescription("Check environment"); + $this->setDescription("Check environment"); return $this; } @@ -52,7 +51,6 @@ class CheckEnvironment extends Command $output->writeln(''); foreach ($collection->getRequirements() as $requirement) { - $result = $requirement->isFulfilled() ? 'OK ' : ($requirement->isOptional() ? 'WARNING ' : 'ERROR '); $output->write(' ' . $result); @@ -69,7 +67,6 @@ class CheckEnvironment extends Command $output->writeln(''); foreach ($collection->getRecommendations() as $requirement) { - $result = $requirement->isFulfilled() ? 'OK ' : ($requirement->isOptional() ? 'WARNING ' : 'ERROR '); $output->write(' ' . $result); diff --git a/lib/Alchemy/Phrasea/Controller/Setup.php b/lib/Alchemy/Phrasea/Controller/Setup.php index c3983fbf56..1b031ebdf9 100644 --- a/lib/Alchemy/Phrasea/Controller/Setup.php +++ b/lib/Alchemy/Phrasea/Controller/Setup.php @@ -22,7 +22,6 @@ use Silex\ControllerProviderInterface; use Silex\Application as SilexApplication; use Symfony\Component\HttpFoundation\Request; - class Setup implements ControllerProviderInterface { public function connect(SilexApplication $app) @@ -51,7 +50,7 @@ class Setup implements ControllerProviderInterface return $app['twig']->render('/setup/index.html.twig', array( 'locale' => $app['locale'], - 'available_locales' => \Alchemy\Phrasea\Application::getAvailableLanguages(), + 'available_locales' => Application::getAvailableLanguages(), 'current_servername' => $request->getScheme() . '://' . $request->getHttpHost() . '/', 'requirementsCollection' => $requirementsCollection, )); @@ -87,17 +86,15 @@ class Setup implements ControllerProviderInterface $warnings[] = _('It is not recommended to install Phraseanet without HTTPS support'); } - return $app['twig']->render( - '/setup/step2.html.twig' - , array( - 'locale' => $app['locale'] - , 'available_locales' => Application::getAvailableLanguages() - , 'available_templates' => array('en', 'fr') - , 'warnings' => $warnings - , 'error' => $request->query->get('error') - , 'current_servername' => $request->getScheme() . '://' . $request->getHttpHost() . '/' - , 'discovered_binaries' => \setup::discover_binaries() - , 'rootpath' => dirname(dirname(dirname(dirname(__DIR__)))) . '/' + return $app['twig']->render('/setup/step2.html.twig', array( + 'locale' => $app['locale'], + 'available_locales' => Application::getAvailableLanguages(), + 'available_templates' => array('en', 'fr'), + 'warnings' => $warnings, + 'error' => $request->query->get('error'), + 'current_servername' => $request->getScheme() . '://' . $request->getHttpHost() . '/', + 'discovered_binaries' => \setup::discover_binaries(), + 'rootpath' => realpath(__DIR__ . '/../../../../'), )); } @@ -165,9 +162,10 @@ class Setup implements ControllerProviderInterface $app->openAccount(new \Session_Authentication_None($user)); - $redirection = '/admin/?section=taskmanager¬ice=install_success'; - - return $app->redirect($redirection); + return $app->redirect($app->path('admin', array( + 'section' => 'taskmanager', + 'notice' => 'install_success', + ))); } catch (\Exception $e) { } diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php index aa8a7408d1..45ab99334c 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php @@ -17,8 +17,6 @@ use Silex\ControllerProviderInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -// check ***::*** - class Thesaurus implements ControllerProviderInterface { public function connect(Application $app) @@ -499,10 +497,10 @@ class Thesaurus implements ControllerProviderInterface } } } - if (! $query) { + if (!$query) { $query = $query0; } - if (! $label) { + if (!$label) { $label = $label0; } diff --git a/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php b/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php index bd06cabe59..59d7cf3eb3 100644 --- a/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php +++ b/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php @@ -31,9 +31,6 @@ class ConfigurationTester private $requirements; private $versionProbes; - const PROD_ENV = 'prod'; - const DEV_ENV = 'dev'; - public function __construct(Application $app) { $this->app = $app; diff --git a/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php index cfd8cd9e97..b71bc6896a 100644 --- a/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php +++ b/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php @@ -16,8 +16,6 @@ use Alchemy\Phrasea\Setup\Requirements\BinariesRequirements; class BinariesProbe extends BinariesRequirements implements ProbeInterface { - const REQUIRED_PHP_VERSION = '5.3.3'; - public function __construct(\registryInterface $registry) { parent::__construct(array_filter(array( diff --git a/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php index 0ec1630bff..d72e59fbd0 100644 --- a/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php +++ b/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php @@ -26,6 +26,11 @@ class SearchEngineProbe extends RequirementCollection implements ProbeInterface } } + /** + * {@inheritdoc} + * + * @return SearchEngineProbe + */ public static function create(Application $app) { return new static($app['phraseanet.SE']); diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php b/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php index 4f985362e0..2906e59bae 100644 --- a/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php +++ b/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php @@ -16,8 +16,6 @@ use Symfony\Component\Process\ExecutableFinder; class BinariesRequirements extends RequirementCollection { - const REQUIRED_PHP_VERSION = '5.3.3'; - public function __construct($binaries = array()) { $this->setName('Binaries'); diff --git a/templates/web/admin/dashboard.html.twig b/templates/web/admin/dashboard.html.twig index de8efb6e47..65fb1558e2 100644 --- a/templates/web/admin/dashboard.html.twig +++ b/templates/web/admin/dashboard.html.twig @@ -4,7 +4,6 @@ {% if requirements.getRequirements() is not empty %}
  • {% trans 'Requirements' %}
  • {% for requirement in requirements.getRequirements() %} -
  • {{ requirement.getTestMessage }} @@ -19,7 +18,6 @@ {% if requirements.getRecommendations() is not empty %}
  • {% trans 'Recommendations' %}
  • {% for requirement in requirements.getRecommendations() %} -
  • {{ requirement.getTestMessage }} diff --git a/templates/web/setup/index.html.twig b/templates/web/setup/index.html.twig index e4f9bf805d..674fb09378 100644 --- a/templates/web/setup/index.html.twig +++ b/templates/web/setup/index.html.twig @@ -14,87 +14,85 @@ {% block content %}
    - - - + +
    -
    -

    - INSTALL -

    -

    - Please have a look a this recommendations -

    - - {% for requirements in requirementsCollection %} - - - - {% for requirement in requirements.getRequirements() %} - - - + + {% endfor %} + {% endfor %} +
    -

    {{ requirements.getName() }} requirements

    -
    - {% if requirement.isFulfilled() %} - OK - {% elseif requirement.isOptional() %} - WARNING - {% else %} - ERROR - {% endif %} - - {{ requirement.getTestMessage }} + + + - -
    +
    +

    + INSTALL +

    +

    + Please have a look a this recommendations +

    + + {% for requirements in requirementsCollection %} + + + + {% for requirement in requirements.getRequirements() %} + + + - - {% endfor %} + {% if not requirement.isFulfilled() %} + {{ requirement.getHelpText() }} + {% endif %} + + + {% endfor %} - - - - {% for requirement in requirements.getRecommendations() %} - + + + + {% for requirement in requirements.getRecommendations() %} + - - + - - {% endfor %} - - - {% endfor %} -
    +

    {{ requirements.getName() }} requirements

    +
    + {% if requirement.isFulfilled() %} + OK + {% elseif requirement.isOptional() %} + WARNING + {% else %} + ERROR + {% endif %} + + {{ requirement.getTestMessage }} - {% if not requirement.isFulfilled() %} - {{ requirement.getHelpText() }} - {% endif %} -
    -

    {{ requirements.getName() }} recommendations

    -
    +

    {{ requirements.getName() }} recommendations

    +
    - {% if requirement.isFulfilled() %} - OK - {% elseif requirement.isOptional() %} - WARNING - {% else %} - ERROR - {% endif %} - - {{ requirement.getTestMessage }} + + {% if requirement.isFulfilled() %} + OK + {% elseif requirement.isOptional() %} + WARNING + {% else %} + ERROR + {% endif %} + + {{ requirement.getTestMessage }} - {% if not requirement.isFulfilled() %} - {{ requirement.getHelpText() }} - {% endif %} -
    -
    -
    - - - - -
    - Continue Install -
    -
    - -
    + {% if not requirement.isFulfilled() %} + {{ requirement.getHelpText() }} + {% endif %} +
    +
    +
    + + + + +
    + Continue Install +
    +
    + +
    {% endblock %} diff --git a/templates/web/setup/step2.html.twig b/templates/web/setup/step2.html.twig index d21d33f791..48c400fbec 100644 --- a/templates/web/setup/step2.html.twig +++ b/templates/web/setup/step2.html.twig @@ -327,19 +327,19 @@ {% endif %} - {% for warning in warnings %} - - - {{ warning }} - - - {% endfor %} + {% for warning in warnings %} + + + {{ warning }} + + + {% endfor %} {% if warnings is not empty %} - - - {% trans 'Review system configuration' %} - - + + + {% trans 'Review system configuration' %} + + {% endif %} diff --git a/tests/Alchemy/Tests/Phrasea/Command/Setup/CheckEnvironmentTest.php b/tests/Alchemy/Tests/Phrasea/Command/Setup/CheckEnvironmentTest.php index d964e85fb8..8ad208d355 100644 --- a/tests/Alchemy/Tests/Phrasea/Command/Setup/CheckEnvironmentTest.php +++ b/tests/Alchemy/Tests/Phrasea/Command/Setup/CheckEnvironmentTest.php @@ -14,4 +14,4 @@ class CheckEnvironmentTest extends \PhraseanetPHPUnitAbstract $command = new CheckEnvironment('system:check'); $this->assertEquals(0, $command->execute($input, $output)); } -} \ No newline at end of file +}