Merge branch 'cyy_59430' into 'master'

* Finish task #59430.

See merge request easycorp/zentaopms!4404
This commit is contained in:
李玉春
2022-07-07 05:57:05 +00:00
3 changed files with 24 additions and 2 deletions
+19
View File
@@ -2896,4 +2896,23 @@ class gitlabModel extends model
$html .= '</div>';
return $html;
}
/**
* Download zip code.
*
* @param int $gitlabID
* @param int $projectID
* @param string $branch
* @param string $ext tar.gz|tar.bz2|tbz|tbz2|tb2|bz2|tar|zip
* @access public
* @return string
*/
public function downloadCode($gitlabID = 0, $projectID = 0, $branch = '', $ext = 'zip')
{
if(empty($gitlabID) or empty($projectID)) return false;
$url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/repository/archive." . $ext);
if($branch) $url .= '&sha=' . $branch;
return $url;
}
}