Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / bin / doctrine.php
1 <?php
2
3 require_once 'Doctrine/Common/ClassLoader.php';
4
5 $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
6 $classLoader->register();
7
8 $classLoader = new \Doctrine\Common\ClassLoader('Symfony');
9 $classLoader->register();
10
11 $configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
12
13 $helperSet = null;
14 if (file_exists($configFile)) {
15     if ( ! is_readable($configFile)) {
16         trigger_error(
17             'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
18         );
19     }
20
21     require $configFile;
22     
23     foreach ($GLOBALS as $helperSetCandidate) {
24         if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
25             $helperSet = $helperSetCandidate;
26             break;
27         }
28     }
29 }
30
31 $helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet();
32
33 $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\DBAL\Version::VERSION);
34 $cli->setCatchExceptions(true);
35 $cli->setHelperSet($helperSet);
36 $cli->addCommands(array(
37     // DBAL Commands
38     new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
39     new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
40
41 ));
42 $cli->run();