1
0

status.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Andreas Fischer <bantu@owncloud.com>
  6. * @author Christopher Schäpers <kondou@ts.unde.re>
  7. * @author Frank Karlitschek <frank@karlitschek.de>
  8. * @author Joas Schilling <coding@schilljs.com>
  9. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  10. * @author Kristof Provost <github@sigsegv.be>
  11. * @author Lukas Reschke <lukas@statuscode.ch>
  12. * @author martin.mattel@diemattels.at <martin.mattel@diemattels.at>
  13. * @author Masaki Kawabata Neto <masaki.kawabata@gmail.com>
  14. * @author Morris Jobke <hey@morrisjobke.de>
  15. *
  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. require_once __DIR__ . '/lib/versioncheck.php';
  32. try {
  33. require_once __DIR__ . '/lib/base.php';
  34. $systemConfig = \OC::$server->getSystemConfig();
  35. $installed = (bool) $systemConfig->getValue('installed', false);
  36. $maintenance = (bool) $systemConfig->getValue('maintenance', false);
  37. # see core/lib/private/legacy/defaults.php and core/themes/example/defaults.php
  38. # for description and defaults
  39. $defaults = new \OCP\Defaults();
  40. $values=array(
  41. 'installed'=>$installed,
  42. 'maintenance' => $maintenance,
  43. 'needsDbUpgrade' => \OCP\Util::needUpgrade(),
  44. 'version'=>implode('.', \OCP\Util::getVersion()),
  45. 'versionstring'=>OC_Util::getVersionString(),
  46. 'edition'=> '',
  47. 'productname'=>$defaults->getName());
  48. if (OC::$CLI) {
  49. print_r($values);
  50. } else {
  51. header('Access-Control-Allow-Origin: *');
  52. header('Content-Type: application/json');
  53. echo json_encode($values);
  54. }
  55. } catch (Exception $ex) {
  56. http_response_code(500);
  57. \OC::$server->getLogger()->logException($ex, ['app' => 'remote']);
  58. }