mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
Addressed github review
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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() ? '<info>OK </info>' : ($requirement->isOptional() ? '<comment>WARNING</comment> ' : '<error>ERROR</error> ');
|
||||
$output->write(' ' . $result);
|
||||
|
||||
@@ -69,7 +67,6 @@ class CheckEnvironment extends Command
|
||||
$output->writeln('');
|
||||
|
||||
foreach ($collection->getRecommendations() as $requirement) {
|
||||
|
||||
$result = $requirement->isFulfilled() ? '<info>OK </info>' : ($requirement->isOptional() ? '<comment>WARNING</comment> ' : '<error>ERROR</error> ');
|
||||
$output->write(' ' . $result);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
{% if requirements.getRequirements() is not empty %}
|
||||
<li><strong>{% trans 'Requirements' %}</strong></li>
|
||||
{% for requirement in requirements.getRequirements() %}
|
||||
|
||||
<li class="{% if not requirement.isFulfilled() %}{% if not requirement.isOptional() %}blocker{% else %}non-blocker{% endif %}{% else %}good-enough{% endif %}">
|
||||
{{ requirement.getTestMessage }}
|
||||
|
||||
@@ -19,7 +18,6 @@
|
||||
{% if requirements.getRecommendations() is not empty %}
|
||||
<li><strong>{% trans 'Recommendations' %}</strong></li>
|
||||
{% for requirement in requirements.getRecommendations() %}
|
||||
|
||||
<li class="{% if not requirement.isFulfilled() %}{% if not requirement.isOptional() %}blocker{% else %}non-blocker{% endif %}{% else %}good-enough{% endif %}">
|
||||
{{ requirement.getTestMessage }}
|
||||
|
||||
|
||||
@@ -78,8 +78,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user