Commit d891b43f authored by dj3c1t's avatar dj3c1t

install/requirements

parent 03fccb79
......@@ -8,8 +8,22 @@ use Symfony\Component\HttpFoundation\Response;
class InstallController extends Controller {
public function requirementsAction(Request $request) {
require dirname($this->container->get('kernel')->getRootDir())."/app/SymfonyRequirements.php";
$symfonyRequirements = new \SymfonyRequirements();
return $this->render(
'Dj3c1tAppBundle:Install:requirements.html.twig',
array(
"symfonyRequirements" => $symfonyRequirements,
)
);
}
public function indexAction(Request $request) {
$im = $this->container->get('dj3c1t_app.install_manager');
if($im->isInstalled()) {
return $this->redirect($this->generateUrl('homepage'));
}
$parameters = $im->getParameters();
if($request->getMethod() == 'POST') {
try {
......
install_requirements:
path: /install/requirements
defaults: { _controller: Dj3c1tAppBundle:Install:requirements }
install:
path: /install
defaults: { _controller: Dj3c1tAppBundle:Install:index }
......
{% extends '::base.html.twig' %}
{% block header %}
<h1>Installation</h1>
{% endblock %}
{% block main %}
{{ parent() }}
<div class="row">
<div class="col-xs-10 col-xs-offset-1">
<h3>Pre-requis</h3>
{% if symfonyRequirements.failedRequirements|length > 0 %}
<h4>Problemes</h4>
<ol>
{% for requirement in symfonyRequirements.failedRequirements %}
<li>
{% autoescape false %}
{{ requirement.helpHtml }}
{% endautoescape %}
</li>
{% endfor %}
</ol>
{% endif %}
{% if symfonyRequirements.failedRecommendations|length > 0 %}
<h4>Recommandations</h4>
<ol>
{% for recommendation in symfonyRequirements.failedRecommendations %}
<li>
{% autoescape false %}
{{ recommendation.helpHtml }}
{% endautoescape %}
</li>
{% endfor %}
</ol>
{% endif %}
{% if symfonyRequirements.hasPhpIniConfigIssue() %}
<p>*
{% if symfonyRequirements.phpIniConfigPath %}
Changes to the <strong>php.ini</strong> file must be done in
"<strong>{{ symfonyRequirements.phpIniConfigPath }}</strong>".
{% else %}
To change settings, create a "<strong>php.ini</strong>" file.
{% endif %}
</p>
{% endif %}
</div>
</div>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment