console.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/env php
  2. <?php
  3. /* For licensing terms, see /license.txt */
  4. set_time_limit(0);
  5. if (PHP_SAPI != 'cli') {
  6. die("Cannot be called by any other method than the command line.");
  7. }
  8. require_once dirname(__FILE__).'/../main/inc/global.inc.php';
  9. // Variable $helperSet is defined inside cli-config.php
  10. require __DIR__ . '/config/console-config.php';
  11. //$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION);
  12. $cli = new \Symfony\Component\Console\Application('Chamilo CLI');
  13. $cli->setCatchExceptions(true);
  14. $helperSet = $cli->getHelperSet();
  15. foreach ($helpers as $name => $helper) {
  16. $helperSet->set($helper, $name);
  17. }
  18. $cli->addCommands(array(
  19. // DBAL Commands
  20. new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
  21. new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
  22. // ORM Commands
  23. new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
  24. new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
  25. new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
  26. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
  27. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
  28. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
  29. new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
  30. new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
  31. new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
  32. new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
  33. new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
  34. new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
  35. new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
  36. new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
  37. // Migrations Commands
  38. new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(),
  39. new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),
  40. new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(),
  41. new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(),
  42. new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(),
  43. new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand(),
  44. //Chamilo commands
  45. new ChamiloLMS\Command\Database\UpgradeCommand(),
  46. new ChamiloLMS\Command\Database\InstallCommand(),
  47. new ChamiloLMS\Command\Database\StatusCommand(),
  48. new ChamiloLMS\Command\Database\SetupCommand(),
  49. //Chash commands
  50. new Chash\Command\Database\RunSQLCommand(),
  51. new Chash\Command\Database\DumpCommand(),
  52. new Chash\Command\Database\RestoreCommand(),
  53. new Chash\Command\Database\SQLCountCommand(),
  54. new Chash\Command\Database\FullBackupCommand(),
  55. new Chash\Command\Database\DropDatabaseCommand(),
  56. new Chash\Command\Files\CleanTempFolderCommand(),
  57. new Chash\Command\Files\CleanConfigFiles(),
  58. new Chash\Command\Translation\ExportLanguageCommand(),
  59. new Chash\Command\Translation\ImportLanguageCommand()
  60. ));
  61. $cli->run();