This is a simple Symfony 7.2 demo project using PHP 8.4.
This demo is using AssetMapper. To see a version with Encore, switch to the unmaintained webpack-encore
branch.
Downloading the project :
user@host ~$ cd [PATH_WHERE_TO_PUT_THE_PROJECT] # E.g. ~/projects/
user@host projects$ git clone https://github.com/cyrilverloop/symfony-demo.git
user@host projects$ cd symfony-demo
This demo uses 3 Docker images based on :
mariadb
to run the database;php:apache
to run the web server;composer
to install PHP dependencies;
Define a mariadb root password in the ./mariadb/.password
file (see ./mariadb/.password.dist
example)
and build the app image :
user@host symfony-demo$ docker compose build
Define the database configuration for Symfony (see ./app/.env
or ./app/.env.local.dist
)
and install the PHP dependencies :
user@host symfony-demo$ docker compose run --rm app composer install -o [--no-dev]
The "--no-dev" option is for the production environment.
For the development and the test environments only :
user@host symfony-demo$ docker compose run --rm app phive install --trust-gpg-keys 4AA394086372C20A,12CE0F1D262429A5,31C7E470E2138192,8AC0BAA79732DD42,C5095986493B4AA0
user@host symfony-demo$ docker compose run --rm app ./bin/console doctrine:database:create [-e test]
user@host symfony-demo$ docker compose run --rm app ./bin/console doctrine:migrations:migrate [--no-interaction] [-e test]
The "-e test" option is to for the test environment which uses Sqlite.
user@host symfony-demo$ docker compose run --rm app bin/console asset-map:compile
Once the installation is complete, you can start the containers with :
user@host symfony-demo$ docker compose up -d
The demo will be available in your browser through : http://127.0.0.1/index.php/
To stop the containers :
user@host symfony-demo$ docker compose down
First, you need to configure the app and create the database for the test environment. Then, run the tests :
user@host symfony-demo$ docker compose run --rm app ./tools/phpunit -c ./ci/phpunit.xml
The generated outputs will be in ./ci/phpunit/
.
And, run the mutation tests :
user@host symfony-demo$ docker compose run --rm app ./tools/infection -c./ci/infection.json
The generated outputs will be in ./ci/infection/
.
To generate the PHPDoc, use this command after installing phive dependencies :
user@host symfony-demo$ docker compose run --rm app ./tools/phpDocumentor --config ./ci/phpdoc.xml
The generated HTML documentation will be in ./app/ci/phpdoc/
.