1
0

register_command.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Björn Schießle <bjoern@schiessle.org>
  7. * @author Christian Kampka <christian@kampka.net>
  8. * @author Christoph Wurst <christoph@owncloud.com>
  9. * @author Joas Schilling <coding@schilljs.com>
  10. * @author Lukas Reschke <lukas@statuscode.ch>
  11. * @author Morris Jobke <hey@morrisjobke.de>
  12. * @author Robin Appelman <robin@icewind.nl>
  13. * @author Robin McCorkell <robin@mccorkell.me.uk>
  14. * @author Roeland Jago Douma <roeland@famdouma.nl>
  15. * @author Thomas Müller <thomas.mueller@tmit.eu>
  16. * @author Victor Dubiniuk <dubiniuk@owncloud.com>
  17. * @author Vincent Petry <pvince81@owncloud.com>
  18. *
  19. * @license AGPL-3.0
  20. *
  21. * This code is free software: you can redistribute it and/or modify
  22. * it under the terms of the GNU Affero General Public License, version 3,
  23. * as published by the Free Software Foundation.
  24. *
  25. * This program is distributed in the hope that it will be useful,
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU Affero General Public License for more details.
  29. *
  30. * You should have received a copy of the GNU Affero General Public License, version 3,
  31. * along with this program. If not, see <http://www.gnu.org/licenses/>
  32. *
  33. */
  34. /** @var $application Symfony\Component\Console\Application */
  35. $application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand());
  36. $application->add(new OC\Core\Command\Status);
  37. $application->add(new OC\Core\Command\Check(\OC::$server->getConfig()));
  38. $infoParser = new \OC\App\InfoParser();
  39. $application->add(new OC\Core\Command\App\CheckCode($infoParser));
  40. $application->add(new OC\Core\Command\L10n\CreateJs());
  41. $application->add(new \OC\Core\Command\Integrity\SignApp(
  42. \OC::$server->getIntegrityCodeChecker(),
  43. new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
  44. \OC::$server->getURLGenerator()
  45. ));
  46. $application->add(new \OC\Core\Command\Integrity\SignCore(
  47. \OC::$server->getIntegrityCodeChecker(),
  48. new \OC\IntegrityCheck\Helpers\FileAccessHelper()
  49. ));
  50. $application->add(new \OC\Core\Command\Integrity\CheckApp(
  51. \OC::$server->getIntegrityCodeChecker()
  52. ));
  53. $application->add(new \OC\Core\Command\Integrity\CheckCore(
  54. \OC::$server->getIntegrityCodeChecker()
  55. ));
  56. if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
  57. $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
  58. $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager()));
  59. $application->add(new OC\Core\Command\App\GetPath());
  60. $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
  61. $application->add(new OC\Core\Command\TwoFactorAuth\Enable(
  62. \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
  63. ));
  64. $application->add(new OC\Core\Command\TwoFactorAuth\Disable(
  65. \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
  66. ));
  67. $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
  68. $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
  69. $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
  70. $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
  71. $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
  72. $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
  73. $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
  74. $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
  75. $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
  76. $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
  77. $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
  78. $application->add(new OC\Core\Command\Db\GenerateChangeScript());
  79. $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getConfig())));
  80. $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
  81. $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
  82. $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager()));
  83. $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager()));
  84. $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
  85. $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
  86. $application->add(new OC\Core\Command\Encryption\DecryptAll(
  87. \OC::$server->getEncryptionManager(),
  88. \OC::$server->getAppManager(),
  89. \OC::$server->getConfig(),
  90. new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
  91. new \Symfony\Component\Console\Helper\QuestionHelper())
  92. );
  93. $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
  94. $application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
  95. $view = new \OC\Files\View();
  96. $util = new \OC\Encryption\Util(
  97. $view,
  98. \OC::$server->getUserManager(),
  99. \OC::$server->getGroupManager(),
  100. \OC::$server->getConfig()
  101. );
  102. $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
  103. $view,
  104. \OC::$server->getUserManager(),
  105. \OC::$server->getConfig(),
  106. $util,
  107. new \Symfony\Component\Console\Helper\QuestionHelper()
  108. )
  109. );
  110. $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
  111. $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
  112. $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
  113. $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
  114. $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
  115. $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
  116. $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger()));
  117. $application->add(new OC\Core\Command\Maintenance\Repair(
  118. new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(),
  119. \OC::$server->getEventDispatcher()));
  120. $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
  121. $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
  122. $application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
  123. $application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
  124. $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
  125. $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager()));
  126. $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
  127. $application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
  128. $application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager()));
  129. $application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
  130. $application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
  131. $application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
  132. $application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
  133. $application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(null), \OC::$server->getL10N('core')));
  134. $application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager(null)));
  135. $application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager(null)));
  136. } else {
  137. $application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getConfig()));
  138. }