register_command.php 7.8 KB

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