Training some best practices of modern PHP development
By default this app uses:
Fast route
Service Container
Doctrine 2
Plates
Symfony command line
You can create new users with the follow command:
(before execute this command follow the instructions of the docs)
php console user:create
curl -sS https://getcomposer.org/installer | php
php composer.phar install
Debian 8 Vagrant image
which is preconfigured for testing PHP apps and developing extensions across many versions of PHP.
You can see all documentation in doc/vagrant or https://github.com/rlerdorf/php7dev
Edit your /etc/hosts file
192.168.7.8 training.dev
vagrant up
vagrant ssh
Edit nginx config. file
sudo vim /etc/nginx/conf.d/default.conf
and change root:
root /var/www/default/public;
sudo service nginx reload
You can run now the app in your browser: http://training.dev
Vagrant contain a MySQL
Execute the follow command:
ssh -C -N -f -L3306:127.0.0.1:3306 vagrant@192.168.7.8
And execute the SQL needed to update the database schema:
php bin/doctrine orm:schema-tool:update --force
Vagrant contain a RabbitMQ
user vagrant
pwd vagrant
http://training.dev:15672
FastRoute link - Fast request router for PHP https://github.com/nikic/FastRoute
Small but powerful dependency injection container http://container.thephpleague.com
Doctrine 2 is an object-relational mapper (ORM) for PHP 5.4+
Mapping files are available in:
src/Training/Infrastructure/Persistence/Doctrine/mapping
Native PHP template system http://platesphp.com
All templates are in: src/Training/Infrastructure/UI/View/Plates
All controllers are in: src/Training/Infrastructure/UI/Controller
Symfony Console Component
The Console component eases the creation of beautiful and testable command line interfaces.
You can run the command lines with the follow command: php console
Unit Tests are available.
You can run the tests with the follow command: php bin/phpunit