title: how to configure doctrine command line tools on zenframework 2
body: <p>i am using doctrine 2 on zendframework 2. i have configured both correcly and they are both working.</p>
  
  <p>i however wish to use <strong>doctrine's command line tool</strong> to generate entities etc. </p>
  
  <p>i have followed doctrine's instructions and created a cli-config.php page in the root of my application: 
  <a href="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html" rel="nofollow">http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html</a> </p>
  
  <p>i am however lost on two issues; 
  the configuration requires a <strong>bootstrap php page</strong>; however, zendframework 2 does not use a bootstrap page; so what would the equivalent be?</p>
  
  <p>Secondly, it requires us to obtain an entity mangager; would the method below be the correct way to get the entity manager: </p>
  
  <pre><code>public function getEntityManager()
      {
          if (null === $this-&gt;em) {
              $this-&gt;em = $this-&gt;getServiceLocator()-&gt;get('doctrine.entitymanager.orm_default');
          }
          return $this-&gt;em;
      }
  </code></pre>
  
  <p><strong>below is how the cli-config.php page should look;</strong>  </p>
  
  <pre><code>// cli-config.php
  require_once 'my_bootstrap.php';
  
  // Any way to access the EntityManager from  your application
  $em = GetMyEntityManager();
  
  $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
      'db' =&gt; new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em-&gt;getConnection()),
      'em' =&gt; new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
  ));
  </code></pre>
  
  <p>i would really appreciate any help or advice on this matter.</p>
  
  <p>warm regards </p>
  
  <p>Andreea </p>
  
  <p><strong>the matter has been resolved:!!</strong> </p>
  
  <p>it did not work because i was using a <a href="http://cygwin.com/cygwin-ug-net/using.html" rel="nofollow">cygdrive command line</a>. however, when i switched to git bash it worked perfectly. with git bash i have to use the command:  </p>
  
  <pre><code>C: &gt; cd project-directory
  project-dir &gt; vendor\bin\doctrine-module orm:validate-schema
  </code></pre>