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 OC\Core\Command\Status);
  36. $application->add(new OC\Core\Command\Check(\OC::$server->getConfig()));
  37. $infoParser = new \OC\App\InfoParser(\OC::$server->getURLGenerator());
  38. $application->add(new OC\Core\Command\App\CheckCode($infoParser));
  39. $application->add(new OC\Core\Command\L10n\CreateJs());
  40. $application->add(new \OC\Core\Command\Integrity\SignApp(
  41. \OC::$server->getIntegrityCodeChecker(),
  42. new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
  43. \OC::$server->getURLGenerator()
  44. ));
  45. $application->add(new \OC\Core\Command\Integrity\SignCore(
  46. \OC::$server->getIntegrityCodeChecker(),
  47. new \OC\IntegrityCheck\Helpers\FileAccessHelper()
  48. ));
  49. $application->add(new \OC\Core\Command\Integrity\CheckApp(
  50. \OC::$server->getIntegrityCodeChecker()
  51. ));
  52. $application->add(new \OC\Core\Command\Integrity\CheckCore(
  53. \OC::$server->getIntegrityCodeChecker()
  54. ));
  55. if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
  56. $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
  57. $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager()));
  58. $application->add(new OC\Core\Command\App\GetPath());
  59. $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
  60. $application->add(new OC\Core\Command\TwoFactorAuth\Enable(
  61. \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
  62. ));
  63. $application->add(new OC\Core\Command\TwoFactorAuth\Disable(
  64. \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
  65. ));
  66. $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
  67. $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
  68. $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
  69. $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
  70. $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
  71. $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
  72. $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
  73. $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
  74. $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
  75. $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
  76. $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
  77. $application->add(new OC\Core\Command\Db\GenerateChangeScript());
  78. $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory()));
  79. $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
  80. $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
  81. $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager()));
  82. $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager()));
  83. $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
  84. $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
  85. $application->add(new OC\Core\Command\Encryption\DecryptAll(
  86. \OC::$server->getEncryptionManager(),
  87. \OC::$server->getAppManager(),
  88. \OC::$server->getConfig(),
  89. new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
  90. new \Symfony\Component\Console\Helper\QuestionHelper())
  91. );
  92. $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
  93. $application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
  94. $view = new \OC\Files\View();
  95. $util = new \OC\Encryption\Util(
  96. $view,
  97. \OC::$server->getUserManager(),
  98. \OC::$server->getGroupManager(),
  99. \OC::$server->getConfig()
  100. );
  101. $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
  102. $view,
  103. \OC::$server->getUserManager(),
  104. \OC::$server->getConfig(),
  105. $util,
  106. new \Symfony\Component\Console\Helper\QuestionHelper()
  107. )
  108. );
  109. $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
  110. $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
  111. $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
  112. $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
  113. $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
  114. $application->add(new OC\Core\Command\Maintenance\Repair(
  115. new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(),
  116. \OC::$server->getEventDispatcher()));
  117. $application->add(new OC\Core\Command\Maintenance\SingleUser(\OC::$server->getConfig()));
  118. $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
  119. $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger()));
  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. }