You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
779 B

<?php
/**
* autodoc
*
* Permettre le calcul d'URL vers un Gitea d'une source issues d'un Vcs
*/
namespace autodoc\Plugin\Core\Compiler\Pass\VcsViewer;
/**
* Calcul d'URL pour visualiser des fichiers sources en ligne sur un Gitea
**/
class Gitea extends DefaultViewer
{
/**
* {@inheritDoc}
**/
public function getUrl() {
$vcs = $this->getVcs();
$url = $this->getUrlViewerRoot();
$url = rtrim($url . '/' . $vcs->getProjectPath(), '/');
$url .= '/src/branch/';
$url .= $vcs->getBranch() . '/';
$url = rtrim($url . $vcs->getInnerPath(), '/');
if ($this->getFilename()) $url .= '/' . $this->getFilename();
if ($this->getLine()) $url .= '#L' . $this->getLine();
return $url;
}
}