This tutorial post will help you to install Doctrine2 inside your PHP project and configure it so that you can use it's features in plain PHP project.
This post illustrates installation of Doctrine2 using Composer.
InstallationFirst create your project directory
now create composer.json
then add following repository information.
Now you are ready to install it via composer, but first we need to install composer into you machine.
Then initiate following command to install Doctrine2
composer creates "autoload.php" file which helps you to autoload all PHP classes of Doctrine2 ORM project.
ConfigurationFirst create configuration file configuration.php for Doctrine2 and include autoload.php inside it.
Then create database configuration details, like database name, username ,password.
Then specify Entity path where you want to store all ORM Entities.
Now create Entity Manager object.
Entity Manager is center source of ORM which handle interaction between Entities and Database.
now you are ready to use Doctrine2 inside your PHP project.
following is complete configuration example which also includes configuration based on XML and YML.
Doctrine 2 is now configured and ready to use.