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 832B

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. $RUNTIME_NOAPPS = true;
  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. if ($argc <= 1) {
  20. echo "Usage:" . PHP_EOL;
  21. echo " " . basename($argv[0]) . " <command>" . PHP_EOL;
  22. exit(0);
  23. }
  24. $command = $argv[1];
  25. array_shift($argv);
  26. if ($command === 'files:scan') {
  27. require_once 'apps/files/console/scan.php';
  28. } else {
  29. echo "Unknown command '$command'" . PHP_EOL;
  30. }