Added integration with git-daemon.

In the configuration it is possible to give a git daemon url to have it
displayed in the source view.
This commit is contained in:
Loic d'Anterroches
2008-08-04 21:24:07 +02:00
parent da1ddc4179
commit 6ad7ee8c71
4 changed files with 80 additions and 33 deletions

View File

@@ -287,4 +287,36 @@ class IDF_Project extends Pluf_Model
}
return $tags;
}
/**
* Get the path to the git repository.
*
* @return string Path to the git repository
*/
public function getGitRepository()
{
$gitrep = Pluf::f('git_repository');
if (substr($gitrep, -4) == '.git') {
return $gitrep;
}
// here we consider that the git_repository is a folder
// containing a series of git repositories
return $gitrep.'/'.$this->shortname.'.git';
}
/**
* Get the url to the repository through git daemon.
*
* @return string Path to the git daemon.
*/
public function getGitDaemonUrl()
{
$gitrep = Pluf::f('git_daemon_url');
if (substr($gitrep, -4) == '.git') {
return $gitrep;
}
// here we consider that the git_repository is a folder
// containing a series of git repositories
return $gitrep.'/'.$this->shortname.'.git';
}
}