register_command.php 7.1 KB

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