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.

console.php 967B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. use Symfony\Component\Console\Application;
  9. require_once 'lib/base.php';
  10. // Don't do anything if ownCloud has not been installed yet
  11. if (!OC_Config::getValue('installed', false)) {
  12. echo "Console can only be used once ownCloud has been installed" . PHP_EOL;
  13. exit(0);
  14. }
  15. if (!OC::$CLI) {
  16. echo "This script can be run from the command line only" . PHP_EOL;
  17. exit(0);
  18. }
  19. // load all apps to get all api routes properly setup
  20. OC_App::loadApps();
  21. $defaults = new OC_Defaults;
  22. $application = new Application($defaults->getName(), \OC_Util::getVersionString());
  23. require_once 'core/register_command.php';
  24. foreach(OC_App::getAllApps() as $app) {
  25. $file = OC_App::getAppPath($app).'/appinfo/register_command.php';
  26. if(file_exists($file)) {
  27. require $file;
  28. }
  29. }
  30. $application->run();