doctrine.php 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. require_once '../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
  3. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\ORM', realpath(__DIR__ . '/../../lib'));
  4. $classLoader->register();
  5. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(__DIR__ . '/../../lib/vendor/doctrine-dbal/lib'));
  6. $classLoader->register();
  7. $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', realpath(__DIR__ . '/../../lib/vendor/doctrine-common/lib'));
  8. $classLoader->register();
  9. $classLoader = new \Doctrine\Common\ClassLoader('Symfony', realpath(__DIR__ . '/../../lib/vendor'));
  10. $classLoader->register();
  11. $classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
  12. $classLoader->register();
  13. $classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
  14. $classLoader->register();
  15. // Variable $helperSet is defined inside cli-config.php
  16. require __DIR__ . '/cli-config.php';
  17. $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION);
  18. $cli->setCatchExceptions(true);
  19. $helperSet = $cli->getHelperSet();
  20. foreach ($helpers as $name => $helper) {
  21. $helperSet->set($helper, $name);
  22. }
  23. $cli->addCommands(array(
  24. // DBAL Commands
  25. new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
  26. new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
  27. // ORM Commands
  28. new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
  29. new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
  30. new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
  31. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
  32. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
  33. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
  34. new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
  35. new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
  36. new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
  37. new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
  38. new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
  39. new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
  40. new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
  41. new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
  42. ));
  43. $cli->run();