config.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * The config entry point of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package entries
  9. * @version 1
  10. * @link https://www.zentao.net
  11. */
  12. class configEntry extends baseEntry
  13. {
  14. /**
  15. * GET method.
  16. *
  17. * @param int $name language,version,timezone etc.
  18. * @access public
  19. * @return string
  20. */
  21. public function get($name)
  22. {
  23. $config = array('name' => $name);
  24. switch($name)
  25. {
  26. case 'language':
  27. $config['value'] = $this->config->default->lang;
  28. break;
  29. case 'version':
  30. $config['value'] = $this->config->version;
  31. break;
  32. case 'charset':
  33. $config['value'] = $this->config->charset;
  34. break;
  35. case 'timezone':
  36. $config['value'] = $this->config->timezone;
  37. break;
  38. case 'systemMode':
  39. $config['value'] = $this->config->systemMode;
  40. break;
  41. default:
  42. return $this->sendError(400, 'No configuration.');
  43. }
  44. return $this->send(200, $config);
  45. }
  46. }