How DokuWiki works: wiki markup is read by a parser which returns instructions. These instructions are processed by a renderer to produce some HTML code.
Just for reference, an instruction looks like that:
Array
(
[0] => internallink
[1] => Array
(
[0] => java:spring:hello_world
[1] => Hello World
)
[2] => 150
)
Instead of redoing the same process at each user request, DokuWiki has a powerful multi-level caching system. By using it, we can just get the cached instructions, and process them with a custom renderer to generate our own HTML code (with links to our PHP pages, not DokuWiki urls).
Download it here. File hierarchy
The index page contains several links to doc.php, which directly uses data files from the dokuwiki folder (a standard dokuwiki installation). DokuWikiRendererXHTML.php is a custom renderer (overrides some methods of DokuWiki's default HTML renderer).
Feedback
Another COOL stuff, something I was looking for a long time. I would suggest two more tutorials when you have free time again ;)
A) Customized your Dokuwiki instance to your site theme or template (like in Kohanaphp, where you have green theme all around the site)
B) How about Trac integration to your site? Just like in kohanaphp again.
I know there are lot of tutorials for above around. But I do not think they will explain things as simple as do.:)
Anyway, thank you very much again!
Tony
March 14, 2008
#1
this is great except my pages are not rendering. i am getting a return of: Warning: Missing config cascade for "smileys" in /home/content/p/l/a/planseaadmin/html/wiki/inc/confutils.php on line 170. any insight?
Justin
January 29, 2009
#2
The need to view the page id DokuWiki first as been a little bit anoying to me, because the wiki is used on several domains and page displaying did not work correctly in some cases. So here is short code how to solve it. Just replace lines:
$cache = new cache_instructions($dokuPageId, $pagePath);
$instructions = $cache->retrieveCache();
with following:
$cache = new cache_instructions($dokuPageId, $pagePath);
if ($cache->useCache()){
$instructions = $cache->retrieveCache();
}
else{
$instructions = p_get_instructions(io_readfile($pagePath));
$cache->storeCache($instructions);
}
Also the line:
$_REQUEST['purge'] = false;
should be removed or replaced with: unset($_REQUEST['purge']); because dokuwiki does not test value of that variable. It tests just presence of it. And method $cache->useCache() always return false when the $_REQUEST['purge'] exists.
Karel Kozlík
April 26, 2009
#3
Wow, that's great Karel, thank you very much for the information!
Jérôme Jaglale
April 26, 2009
#4