|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* autodoc
|
|
|
|
*
|
|
|
|
* Classe à surcharger pour définir un type de Vcs,
|
|
|
|
* permettre l'extraction des informations d'un répertoire appartenant
|
|
|
|
* à celui-ci et permettre le calcul d'URL vers un type de visualisation
|
|
|
|
* en ligne (trac, redmine, …)
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace autodoc\Plugin\Core\Compiler\Pass\VcsInformations;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extraction d'informations d'un dossier utilisant un Vcs
|
|
|
|
**/
|
|
|
|
abstract class VcsInformationsAbstract
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Racine du repository
|
|
|
|
* @var string
|
|
|
|
**/
|
|
|
|
private $urlRoot;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* URL du chemin complet de l'élément du repository
|
|
|
|
* @var string
|
|
|
|
**/
|
|
|
|
private $urlPath;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Chemin depuis la racine du repository
|
|
|
|
* @var string
|
|
|
|
**/
|
|
|
|
private $projectPath;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Chemin depuis la racine du repository
|
|
|
|
* @var string
|
|
|
|
**/
|
|
|
|
private $innerPath;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Branche utilisée
|
|
|
|
* @var string
|
|
|
|
**/
|
|
|
|
private $branch;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Type du VCS
|
|
|
|
* @var string
|
|
|
|
**/
|
|
|
|
private $vcsType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructeur.
|
|
|
|
**/
|
|
|
|
public function __construct() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extrait les informations depuis un répertoire donné
|
|
|
|
*
|
|
|
|
* @param string $dir Chemin du répertoire
|
|
|
|
**/
|
|
|
|
public function extractWithDirectory($dir) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Nettoie les informations enregistrées
|
|
|
|
**/
|
|
|
|
public function clear() {
|
|
|
|
$this->urlRoot = null;
|
|
|
|
$this->urlPath = null;
|
|
|
|
$this->projectPath = null;
|
|
|
|
$this->innerPath = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retourne la racine du repository
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
**/
|
|
|
|
public function getUrlRoot() {
|
|
|
|
return $this->urlRoot;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Définit la racine du repository
|
|
|
|
*
|
|
|
|
* @param string $root
|
|
|
|
**/
|
|
|
|
public function setUrlRoot($root) {
|
|
|
|
$this->urlRoot = $root;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retourne le chemin complet de l'élément du repository
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
**/
|
|
|
|
public function getUrlPath() {
|
|
|
|
return $this->urlPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Définit le chemin complet de l'élément du repository
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
**/
|
|
|
|
public function setUrlPath($path) {
|
|
|
|
$this->urlPath = $path;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retourne le chemin complet de l'élément depuis la racine jusqu’au projet
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
**/
|
|
|
|
public function getProjectPath() {
|
|
|
|
return $this->projectPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Définit le chemin de l'élément depuis la racine jusqu’au projet
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
**/
|
|
|
|
public function setProjectPath($path) {
|
|
|
|
$this->projectPath = $path;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retourne le chemin du projet au répertoire en cours
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
**/
|
|
|
|
public function getInnerPath() {
|
|
|
|
return $this->innerPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Définit le chemin du projet au répertoire en cours
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
**/
|
|
|
|
public function setInnerPath($path) {
|
|
|
|
$this->innerPath = $path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retourne la branche utilisée
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
**/
|
|
|
|
public function getBranch() {
|
|
|
|
return $this->branch;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Définit la branche utilisée
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
**/
|
|
|
|
public function setBranch($branch) {
|
|
|
|
$this->branch = $branch;
|
|
|
|
}
|
|
|
|
}
|