Permalink
Browse files

Add simpler section for 2.4 CLI integration

  • Loading branch information...
1 parent ea19a00 commit c399dcfe58865b839309a710d39c36a4faf9cd32 @beberlei beberlei committed Mar 17, 2013
Showing with 18 additions and 1 deletion.
  1. +18 −1 docs/en/reference/configuration.rst
@@ -107,6 +107,23 @@ 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
+
+ <?php
+ use Doctrine\ORM\Tools\Console\ConsoleRunner;
+
+ // replace with file to your own project bootstrap
+ require_once 'bootstrap.php';
+
+ // replace with mechanism to retrieve EntityManager in your app
+ $entityManager = GetEntityManager();
+
+ return ConsoleRunner::createHelperSet($entityManager);
+
+On Doctrine 2.3 and below:
+
.. code-block:: php
<?php
@@ -115,7 +132,7 @@ following content:
// Any way to access the EntityManager from your application
$em = GetMyEntityManager();
-
+
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)

0 comments on commit c399dcf

Please sign in to comment.