Skip to content

Commit

Permalink
added proper CLI file.
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
  • Loading branch information
taylorotwell committed Feb 27, 2012
1 parent 08af4fa commit 3653eb6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 17 deletions.
36 changes: 36 additions & 0 deletions doctrine
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* Register the core Laravel paths
*/
require 'paths.php';

/**
* Bootstrap the Laravel framework
*/
require path('sys').'core.php';

/**
* Fire up the doctrine bundle
*/
Laravel\Bundle::start('doctrine');

use Doctrine\ORM\Tools\Console\ConsoleRunner,
Symfony\Component\Console\Helper\HelperSet,
Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper,
Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;

/**
* Resolve the entity manager instance out of the IoC container
*/
$em = Laravel\IoC::resolve('doctrine::manager');

/**
* Create the console helper-set and fire up the Doctrine console
*/
$helperSet = new HelperSet(array(
'db' => new ConnectionHelper($em->getConnection()),
'em' => new EntityManagerHelper($em)
));

ConsoleRunner::run($helperSet);
17 changes: 0 additions & 17 deletions doctrine.php

This file was deleted.

0 comments on commit 3653eb6

Please sign in to comment.