Permalink
Browse files

Configure doctrine CLI and add entity path to config example

  • Loading branch information...
1 parent c21ed48 commit 628b0315392c0200024912b0f269314ebd55cce2 @EvanDotPro committed Oct 29, 2011
Showing with 21 additions and 3 deletions.
  1. +11 −2 README.md
  2. +10 −1 bin/doctrine.php
View
@@ -16,7 +16,7 @@ SpiffyDoctrine key to your modules array.
1. cd my/project/folder
2. git clone https://SpiffyJr@github.com/SpiffyJr/SpiffyDoctrine.git modules/SpiffyDoctrine --recursive
3. open my/project/folder/configs/application.config.php and add 'SpiffyDoctrine' to your 'modules' parameter.
- 4. Alter the configuration (most likely your connection) by adding the required changes to
+ 4. Alter the configuration (most likely your connection and entities path(s)) by adding the required changes to
my/project/folder/modules/Application/module.config.php.
## Example standard configuration
@@ -35,6 +35,15 @@ SpiffyDoctrine key to your modules array.
'host' => 'localhost',
'driver' => 'pdo_mysql'
)
+ ),
+ 'em' => array(
+ 'default' => array(
+ 'driver' => array(
+ 'paths' => array(
+ '/path/to/your/entities',
+ ),
+ )
+ )
)
)
)
@@ -58,4 +67,4 @@ you can get them from the SpiffyDoctrine\Container\Container.
## Doctrine CLI
The Doctrine CLI has been pre-configured and is available in SpiffyDoctrine\bin. It should work as
-is without any special configuration required.
+is without any special configuration required.
View
@@ -27,6 +27,15 @@
new Zend\Module\ManagerOptions($appConfig['module_manager_options'])
);
+$bootstrap = new Zend\Mvc\Bootstrap($moduleManager);
+$application = new Zend\Mvc\Application;
+$bootstrap->bootstrap($application);
+$locator = $application->getLocator();
+
\Doctrine\ORM\Tools\Console\ConsoleRunner::run(
- new \Symfony\Component\Console\Helper\HelperSet()
+ new \Symfony\Component\Console\Helper\HelperSet(
+ array(
+ 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($locator->get('em-default'))
+ )
+ )
);

0 comments on commit 628b031

Please sign in to comment.