pipelines.php 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * The pipeline entry point of ZenTaoPMS.
  4. * It is only used by Zcli.
  5. *
  6. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  7. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  8. * @author Yanyi Cao <caoyanyi@easycorp.ltd>
  9. * @package pipeline
  10. * @version 1
  11. * @link https://www.zentao.net
  12. */
  13. class pipelinesEntry extends entry
  14. {
  15. /**
  16. * GET method.
  17. *
  18. * @access public
  19. * @return string
  20. */
  21. public function get()
  22. {
  23. $pipeline = $this->param('pipeline', '');
  24. $repoUrl = $this->param('repoUrl', '');
  25. if(empty($pipeline) and empty($repoUrl)) return $this->sendError(400, 'The parameter is incorrect!');
  26. $repo = $this->loadModel('repo')->getRepoByUrl($repoUrl, $pipeline);
  27. if(empty($repo['data'])) return $this->sendError(400, $repo['message']);
  28. return $this->send(200, array('status' => 'success', 'repo' => $repo['data']));
  29. }
  30. }