Learn about DokuWiki
Learn about DokuWiki
It is not clear that the DokuWiki community wants to have this idea implemented. See also Discussion of this idea.
The idea is to let DokuWiki optionally use Git as backend. That means
This backend should only be used for old revisions, the current revision should be stored in that storage system, but still the plain text files in
data/pages/ should be read.
For Git a pure PHP implementation like glip should be used.
Advantages of this approach:
Hard There are already some wikis based on Git so you don't need to start from zero, but you will have to read and understand a lot of code unless you should already know Git very well, then that task won't be that difficult. You will also need to change code in a lot of places in DokuWiki as we don't have any file access abstraction for accessing stat information (reading/writing is already done in central functions).
Discussion: I'm not sure if this would be as hard as you make it sound. If the data/pages directory was in git, the only change absolutely necessary would be to commit the change each time something has been written to disk (inside the data/pages directory). That would give you quick and easy git back-end storage. The difficulty level on this should be fairly easy, because as was mentioned above all the writing is done in central functions. This basic level of functionality would allow people to clone the repository and keep it on their local machine, edit, and merge back.
The next level of complexity that could be added on after this is incorporating git's history to replace the use of the data/attic directory. There are two big benefits to this: 1) When you revert a page the version tree would look better (and make more sense) to people looking at it from the git side 2) the storage of all that text is much more compact as git only stores differences not a whole copy for each change.
Finally, if you want to get really fancy (and expend a LOT more effort) you could enable features such as branching where you can have multiple different versions of pages live at any time, then merge them back together eventually (or not). I'm not personally convinced that this is very useful. I definitely wouldn't want a feature like this to hold back something simple like the above features.
However, these things wouldn't be necessary for a baseline capability.
The following people volunteered to “mentor” any new developers taking up this task by answering questions, giving tips and reviewing code:
There is a plugin that implements a gitbackend in current DokuWiki but depends on git, so not php-only. See gitbacked plugin.