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.
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* autodoc
|
|
|
|
*
|
|
|
|
* Permettre le calcul d'URL vers un Redmine 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 Redmine
|
|
|
|
**/
|
|
|
|
class Redmine extends DefaultViewer
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritDoc}
|
|
|
|
**/
|
|
|
|
public function getUrl() {
|
|
|
|
$vcs = $this->getVcs();
|
|
|
|
$url = $this->getUrlViewerRoot() . '/repository/entry/';
|
|
|
|
$url = rtrim($url . $vcs->getProjectPath(), '/');
|
|
|
|
$url = rtrim($url . $vcs->getInnerPath(), '/');
|
|
|
|
if ($this->getFilename()) $url .= '/' . $this->getFilename();
|
|
|
|
if ($this->getLine()) $url .= '#L' . $this->getLine();
|
|
|
|
return $url;
|
|
|
|
}
|
|
|
|
}
|