Un projet en Symfony 3.
- Mysql 5.7.15
- Nginx 1.9.1
- PHP 7.0.7
- Node 7+
- Clone this repository
- Install and launch the containers
docker-compose up
- Point the container's IP address to symfony.dev
- Example on mac OS
/etc/hosts
file: '127.0.0.1 symfony.dev' > /etc/hosts - On Windows, please note that the IP may be different (see if some IP is explicited during
docker-compose up
.
- Example on mac OS
- Install Symfony's dependencies using
composer
in thesymfony_php
container:docker exec -it symfony_php composer install
- Enter these parameters when asked to configure the database. Leave the rest as default:
parameters: database_host: db database_name: symfony database_user: root database_password: root
- Install the front-end dependencies:
npm install && npm build
- Launch the browser on
symfony.dev/app_dev.php
docker exec -it symfony_php php bin/console doctrine:schema:drop --force
docker exec -it symfony_php php bin/console doctrine:schema:create
Fake datas (fixtures) generated with the Bazinga Faker Bundle
In order to add fixtures into the database to work with, follow these steps :
1 - make sure to have the last database schema :
docker exec -it symfony_php php bin/console doctrine:schema:update --force
2 - Execute the Bazinga Faker command to populate the database
docker exec -it symfony_php php bin/console faker:populate
NB : Entries are INSERTED into database, your previous entries won't be erased
Fixtures are declared in app/config/config_dev.yml
under the bazinga_faker entry.
We first declare the ORM used and the location (locale) to get the datas in the correct language.
The fixtures are then inserted based on entities.
Example for place entity :
AppBundle\Entity\Place:
number: 50 # Choose the number of entries to generate
custom_formatters:
name: { method: company }
description: { method: realText }
... # Make sure to add one new based on your entity entry
If you need to develop on the front-end:
- Symlink the bundle assets folders in Symfony (optional)
docker exec -it symfony_php bin/console assets:install --symlink
- Start the watcher
npm start
Now when you update the style.scss or app.js file, the bundled files are updated automatically by Gulp.
In PHPStorm go to Settings -> Languages & Frameworks -> PHP
Add a new remote interpreter using the following SSH credentials . host: localhost . port: 2222 . user: root . password: lbmonkey
./scripts/phpmetrics;
The report will be accessible at : /phpmetrics/index.html