Blame view

sources/3rdparty/doctrine/dbal/bin/doctrine-dbal.php 1.26 KB
31b7f2792   Kload   Upgrade to ownclo...
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
43
  <?php
  
  require_once 'Doctrine/Common/ClassLoader.php';
  
  $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
  $classLoader->register();
  
  $classLoader = new \Doctrine\Common\ClassLoader('Symfony');
  $classLoader->register();
  
  $configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
  
  $helperSet = null;
  if (file_exists($configFile)) {
      if ( ! is_readable($configFile)) {
          trigger_error(
              'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
          );
      }
  
      require $configFile;
  
      foreach ($GLOBALS as $helperSetCandidate) {
          if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
              $helperSet = $helperSetCandidate;
              break;
          }
      }
  }
  
  $helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet();
  
  $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\DBAL\Version::VERSION);
  $cli->setCatchExceptions(true);
  $cli->setHelperSet($helperSet);
  $cli->addCommands(array(
      // DBAL Commands
      new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
      new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
      new \Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand(),
  
  ));
  $cli->run();