dokuwiki-plugin-gitbacked
dokuwiki-plugin-gitbacked copied to clipboard
Detect Whether RepoPath is an Absolute Path
As requested by @woolfg in #78, creating a new issue for this.
If the repoPath configuration string is an absolute path, don't prepend DokuWiki's savedir to it.
One way this could be achieved is by changing:
private function initRepo() {
//get path to the repo root (by default DokuWiki's savedir)
if(defined('DOKU_FARM')) {
$repoPath = $this->getConf('repoPath');
} else {
$repoPath = DOKU_INC.$this->getConf('repoPath');
}
to:
private function initRepo() {
//get path to the repo root (by default DokuWiki's savedir)
$repoPath = $this->getConf('repoPath');
if(!defined('DOKU_FARM') && $repoPath[0] !== '/') {
$repoPath = DOKU_INC.$this->getConf('repoPath');
}
I have tested the above change and it works with both absolute and relative paths. I'm submitting this as an issue instead of as a pull request because I've never written PHP before and I'm not familiar with the dokuwiki or gitbacked plugin codebases.
thanks @sjv0, as you already changed the code, you could als send a pull request. we can work together on it in case there is something missing.
OK pull request created. Hope I did it correctly - I haven't done it before.
repoworkdir also needs to be changed in the same way.
@wom-bat Many thanks for this hint - yes this is understood already.