3 require_once 'Doctrine/Common/ClassLoader.php';
5 $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
6 $classLoader->register();
8 $classLoader = new \Doctrine\Common\ClassLoader('Symfony');
9 $classLoader->register();
11 $configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
14 if (file_exists($configFile)) {
15 if ( ! is_readable($configFile)) {
17 'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
23 foreach ($GLOBALS as $helperSetCandidate) {
24 if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
25 $helperSet = $helperSetCandidate;
31 $helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet();
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(
38 new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
39 new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),