Installation and Configuration ============================== Doctrine can be installed with `Composer `_. For older versions we still have `PEAR packages `_. Define the following requirement in your ``composer.json`` file: :: { "require": { "doctrine/orm": "*" } } Then call ``composer install`` from your command line. If you don't know how Composer works, check out their `Getting Started `_ to set up. Class loading ------------- Autoloading is taken care of by Composer. You just have to include the composer autoload file in your project: .. code-block:: php 'pdo_mysql', 'user' => 'root', 'password' => '', 'dbname' => 'foo', ); $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode); $entityManager = EntityManager::create($dbParams, $config); Or if you prefer XML: .. code-block:: php ` section. .. note:: You can learn more about the database connection configuration in the `Doctrine DBAL connection configuration reference `_. Setting up the Commandline Tool ------------------------------- Doctrine ships with a number of command line tools that are very helpful during development. You can call this command from the Composer binary directory: .. code-block:: $ php vendor/bin/doctrine You need to register your applications EntityManager to the console tool to make use of the tasks by creating a ``cli-config.php`` file with the following content: On Doctrine 2.4 and above: .. code-block:: php new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) ));