Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Whether RepoPath is an Absolute Path #80

Closed
sjv0 opened this issue Aug 12, 2022 · 4 comments · Fixed by #83
Closed

Detect Whether RepoPath is an Absolute Path #80

sjv0 opened this issue Aug 12, 2022 · 4 comments · Fixed by #83

Comments

@sjv0
Copy link
Contributor

sjv0 commented Aug 12, 2022

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.

@woolfg
Copy link
Owner

woolfg commented Aug 12, 2022

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.

@sjv0
Copy link
Contributor Author

sjv0 commented Aug 12, 2022

OK pull request created. Hope I did it correctly - I haven't done it before.

@wom-bat
Copy link

wom-bat commented Nov 28, 2022

repoworkdir also needs to be changed in the same way.

@mhoffrog
Copy link
Collaborator

@wom-bat Many thanks for this hint - yes this is understood already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants