Relecture

This commit is contained in:
Gregory Colpart 2017-09-13 18:45:14 +02:00
parent 11ca87b27e
commit 29b428f3fd

View file

@ -1,12 +1,20 @@
# Practice Symfony # Practice Symfony
<http://symfony.com/> * Documentation : <https://symfony.com/doc/current/index.html>
* Rôle : <https://forge.evolix.org/projects/ansible-roles/repository/show/php> avec `php_symfony_requirements: True`
[Symfony](http://symfony.com/) est le framework PHP le plus populaire.
## Prérequis ## Prérequis
<http://symfony.com/doc/current/reference/requirements.html>
### Apache ### Apache
Symfony contient des fichiers `.htaccess` avec des directives DirectoryIndex, Options -MultiViews, Rewrite*, Deny. <http://symfony.com/doc/current/setup/web_server_configuration.html>
Les applications Symfony contiennent souvent des fichiers `.htaccess` avec des directives DirectoryIndex, Options -MultiViews, Rewrite*, Deny.
Il est donc plutôt conseillé d'utiliser [Apache](HowtoApache) en général.
La configuration Apache du VirtualHost doit donc contenir au minimum : La configuration Apache du VirtualHost doit donc contenir au minimum :
@ -16,17 +24,35 @@ AllowOverride Limit FileInfo Indexes Options=All,MultiViews
### PHP ### PHP
<http://symfony.com/doc/current/reference/requirements.html> Le module JSON doit être installé :
Le paquet **php5-json** doit être installé. ~~~
# apt install php7.0-json
~~~
Il faut indiquer le paramètre `date.timezone = "Europe/Paris"` dans les fichiers de configuration PHP : > *Note* : Pour Debian 8
>
> ~~~
> # aptitude install php5-json
> ~~~
Et il faut préciser le paramètre `date.timezone` dans les fichiers de configuration PHP.
Par exemple pour la France :
~~~
# grep -r date.timezone /etc/php/7.0/*/conf.d/zzz-evolinux-custom.ini
/etc/php/7.0/apache2/conf.d/zzz-evolinux-custom.ini: date.timezone = "Europe/Paris"
/etc/php/7.0/cli/conf.d/zzz-evolinux-custom.ini: date.timezone = "Europe/Paris"
/etc/php/7.0/fpm/conf.d/zzz-evolinux-custom.ini: date.timezone = "Europe/Paris"
~~~
- `/etc/php5/apache2/php.ini`
- `/etc/php5/cli/php.ini`
## Installation ## Installation
La méthode conseillée est d'utiliser [Composer](HowtoPHP#composer).
Par exemple pour installer Symfony 3.3 :
~~~ ~~~
$ echo '{"require": {{"symfony/framework-standard-edition": "~3.3"}}' > composer.json $ echo '{"require": {{"symfony/framework-standard-edition": "~3.3"}}' > composer.json
$ composer update $ composer update
@ -61,3 +87,18 @@ Symfony Requirements Checker
Your system is ready to run Symfony projects Your system is ready to run Symfony projects
[...] [...]
~~~ ~~~
## Application Symfony
Pour avoir une application de test, on peut utiliser l'application de nos amis d'[Acseo](http://www.acseo.fr/) disponible sur <https://github.com/acseo/symfony-perf> :
On applique le <https://github.com/acseo/symfony-perf/blob/master/INSTALL.md> :
~~~
$ git clone https://github.com/acseo/symfony-perf.git
$ cd symfony-perf
$ composer install
$ chmod -R g+w var
~~~