diff --git a/src/Console/DoctrineCliCommand.php b/src/Console/DoctrineCliCommand.php new file mode 100644 index 0000000..548b35e --- /dev/null +++ b/src/Console/DoctrineCliCommand.php @@ -0,0 +1,59 @@ +entityManager = $entityManager; + + $this->addArgument( + 'doctrineCliCommand', + InputArgument::REQUIRED, + 'Doctrine cli command.' + ); + } + + public function fire() + { + $consoleRunner = new ConsoleRunner(); + $cliApplication = $consoleRunner->createApplication( + $consoleRunner->createHelperSet($this->entityManager) + ); + + $doctrineCliInput = new ArrayInput(array( + 'command' => $this->input->getArgument('doctrineCliCommand'), + )); + + $cliApplication->run($doctrineCliInput, $this->output); + } +} diff --git a/src/LaravelDoctrineServiceProvider.php b/src/LaravelDoctrineServiceProvider.php index 4e42049..b5cc4a5 100644 --- a/src/LaravelDoctrineServiceProvider.php +++ b/src/LaravelDoctrineServiceProvider.php @@ -50,7 +50,8 @@ public function register() 'Mitch\LaravelDoctrine\Console\GenerateProxiesCommand', 'Mitch\LaravelDoctrine\Console\SchemaCreateCommand', 'Mitch\LaravelDoctrine\Console\SchemaUpdateCommand', - 'Mitch\LaravelDoctrine\Console\SchemaDropCommand' + 'Mitch\LaravelDoctrine\Console\SchemaDropCommand', + 'Mitch\LaravelDoctrine\Console\DoctrineCliCommand', ]); }