Chat application bases on symfony components
- PHP 5.6
- mod_rewrite must be enabled
-
git clone [email protected]:medbenhenda/chat-project.git
-
cd chat-project
-
install dependencies: execute
composer install -
database settings:
Edit
config/database/mysql.ymlfilemysql: driver: pdo_mysql user: root password: '' dbname: chat -
Mapping: create tables in the database:
execute php vendor/doctrine/orm/bin/doctrine orm:schema-tool:update --force
- Generate entities proxies
execute php vendor/doctrine/orm/bin/doctrine orm:generate-proxies
- go to the url
In this project many Symfony component are used: Security, var-dumper, templating, config, YAML, routing, console, http-foundation, validator
Doctrine and Twig 3rd party applications are installed. Doctrine for the mapping between Relationel Database and PHP objects. Twig is used as the templating engine.
the index.php is the front controller that call the kernel to handle the request and send the response.
The config directory contains the configuration of the routes and the config of the database.
The kernel class instantiate the request object, check the route, get the appropriate controller and called its action.
An entityManager is defined in the Kernel directory used along the application. a bootstrap file is defined in the route used by CLI for doctrine commands
App directory contains the application ode. The application is modular there are 2 used modules: CoreModule for the chat and User Module for the handling of user and messages.
The cache directory contains the proxy entities class generate by doctrine (see point 4)
Assets directory contains all front end files (CSS, Js, Images).
cli-config.php file used by doctrine command line it include the bootstrap file