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.2KB

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