You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

register_command.php 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Björn Schießle <schiessle@owncloud.com>
  5. * @author Christian Kampka <christian@kampka.net>
  6. * @author Joas Schilling <nickvergessen@owncloud.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin McCorkell <rmccorkell@karoshi.org.uk>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. * @author Vincent Petry <pvince81@owncloud.com>
  11. *
  12. * @copyright Copyright (c) 2015, ownCloud, Inc.
  13. * @license AGPL-3.0
  14. *
  15. * This code is free software: you can redistribute it and/or modify
  16. * it under the terms of the GNU Affero General Public License, version 3,
  17. * as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License, version 3,
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>
  26. *
  27. */
  28. /** @var $application Symfony\Component\Console\Application */
  29. $application->add(new OC\Core\Command\Status);
  30. $application->add(new OC\Core\Command\Check(\OC::$server->getConfig()));
  31. $infoParser = new \OC\App\InfoParser(\OC::$server->getHTTPHelper(), \OC::$server->getURLGenerator());
  32. $application->add(new OC\Core\Command\App\CheckCode($infoParser));
  33. $application->add(new OC\Core\Command\L10n\CreateJs());
  34. $application->add(new \OC\Core\Command\Integrity\SignApp(
  35. \OC::$server->getIntegrityCodeChecker(),
  36. new \OC\IntegrityCheck\Helpers\FileAccessHelper()
  37. ));
  38. $application->add(new \OC\Core\Command\Integrity\SignCore(
  39. \OC::$server->getIntegrityCodeChecker(),
  40. new \OC\IntegrityCheck\Helpers\FileAccessHelper()
  41. ));
  42. if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
  43. $application->add(new OC\Core\Command\App\Disable());
  44. $application->add(new OC\Core\Command\App\Enable());
  45. $application->add(new OC\Core\Command\App\GetPath());
  46. $application->add(new OC\Core\Command\App\ListApps());
  47. $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
  48. $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
  49. $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
  50. $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
  51. $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
  52. $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
  53. $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
  54. $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
  55. $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
  56. $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
  57. $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
  58. $application->add(new OC\Core\Command\Db\GenerateChangeScript());
  59. $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory()));
  60. $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
  61. $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
  62. $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager()));
  63. $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager()));
  64. $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
  65. $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
  66. $application->add(new OC\Core\Command\Encryption\DecryptAll(
  67. \OC::$server->getEncryptionManager(),
  68. \OC::$server->getAppManager(),
  69. \OC::$server->getConfig(),
  70. new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
  71. new \Symfony\Component\Console\Helper\QuestionHelper())
  72. );
  73. $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
  74. $application->add(new OC\Core\Command\Log\OwnCloud(\OC::$server->getConfig()));
  75. $view = new \OC\Files\View();
  76. $util = new \OC\Encryption\Util(
  77. $view,
  78. \OC::$server->getUserManager(),
  79. \OC::$server->getGroupManager(),
  80. \OC::$server->getConfig()
  81. );
  82. $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
  83. $view,
  84. \OC::$server->getUserManager(),
  85. \OC::$server->getConfig(),
  86. $util,
  87. new \Symfony\Component\Console\Helper\QuestionHelper()
  88. )
  89. );
  90. $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
  91. $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
  92. $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
  93. $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
  94. $application->add(new OC\Core\Command\Maintenance\Repair(new \OC\Repair(\OC\Repair::getRepairSteps()), \OC::$server->getConfig()));
  95. $application->add(new OC\Core\Command\Maintenance\SingleUser(\OC::$server->getConfig()));
  96. $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger()));
  97. $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
  98. $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
  99. $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
  100. $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager()));
  101. $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
  102. } else {
  103. $application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getConfig()));
  104. }