forked from sandrokeil/CodeGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli-config.php
executable file
·42 lines (33 loc) · 1.21 KB
/
cli-config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Sake
*
* @link http://github.com/sandrokeil/CodeGenerator for the canonical source repository
* @copyright Copyright (c) 2014 Sandro Keil
* @license http://github.com/sandrokeil/CodeGenerator/blob/master/LICENSE.txt New BSD License
*/
use Sake\CodeGenerator\Doctrine\ORM\Tools\Console\Command;
/**
* Doctrine 2 console configuration example with Sake\CodeGenerator commands
*/
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir(__DIR__);
// load composer autoloading
if (!($loader = @include 'vendor/autoload.php')) {
throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');
}
use Doctrine\ORM\Tools\Console\ConsoleRunner;
// Run the application!
$serviceManager = Zend\Mvc\Application::init(require 'config/application.config.php')->getServiceManager();
return ConsoleRunner::createHelperSet($serviceManager->get('doctrine.entitymanager.orm_default'));
// note that createApplication may be available in doctrine 2.5
/*
return ConsoleRunner::createApplication(
$helperSet,
new Command\GenerateFormCommand(),
new Command\GenerateInputFilterCommand()
);
*/