console.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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__.'/console-config.php';
  11. $cli = new \Symfony\Component\Console\Application('Chamilo CLI');
  12. $cli->setCatchExceptions(true);
  13. $helperSet = $cli->getHelperSet();
  14. foreach ($helpers as $name => $helper) {
  15. $helperSet->set($helper, $name);
  16. }
  17. $cli->addCommands(array(
  18. // DBAL Commands
  19. new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
  20. new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
  21. // ORM Commands
  22. new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
  23. new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
  24. new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
  25. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
  26. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
  27. new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
  28. new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
  29. new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
  30. new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
  31. new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
  32. new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
  33. new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
  34. new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
  35. new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
  36. // Migrations Commands
  37. new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(),
  38. new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),
  39. new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(),
  40. new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(),
  41. new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(),
  42. new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand(),
  43. //Chamilo commands
  44. new ChamiloLMS\Command\Database\UpgradeCommand(),
  45. new ChamiloLMS\Command\Database\InstallCommand(),
  46. //new ChamiloLMS\Command\Database\InstallExtendCommand(),
  47. new ChamiloLMS\Command\Database\StatusCommand(),
  48. new ChamiloLMS\Command\Database\SetupCommand(),
  49. //new ChamiloLMS\Command\Template\AsseticDumpCommand(),
  50. //Chash commands
  51. new Chash\Command\Database\RunSQLCommand(),
  52. new Chash\Command\Database\DumpCommand(),
  53. new Chash\Command\Database\RestoreCommand(),
  54. new Chash\Command\Database\SQLCountCommand(),
  55. new Chash\Command\Database\FullBackupCommand(),
  56. new Chash\Command\Database\DropDatabaseCommand(),
  57. new Chash\Command\Files\CleanTempFolderCommand(),
  58. new Chash\Command\Files\CleanConfigFiles(),
  59. new Chash\Command\Translation\ExportLanguageCommand(),
  60. new Chash\Command\Translation\ImportLanguageCommand()
  61. ));
  62. $cli->run();