getGitProjectName() public static method

根据git地址获取项目名字
public static getGitProjectName ( $gitUrl ) : mixed
$gitUrl
return mixed
Example #1
0
 /**
  * 打软链
  *
  * @param null $version
  * @return bool
  */
 public function getLinkCommand($version)
 {
     $user = $this->config->release_user;
     $project = Project::getGitProjectName($this->getConfig()->repo_url);
     $currentTmp = sprintf('%s/%s/current-%s.tmp', rtrim($this->getConfig()->release_library, '/'), $project, $project);
     // 遇到回滚,则使用回滚的版本version
     $linkFrom = Project::getReleaseVersionDir($version);
     $cmd[] = sprintf('ln -sfn %s %s', $linkFrom, $currentTmp);
     $cmd[] = sprintf('chown -h %s %s', $user, $currentTmp);
     $cmd[] = sprintf('mv -fT %s %s', $currentTmp, $this->getConfig()->release_to);
     return join(' && ', $cmd);
 }