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
Mar 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
Jan 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
Apr 26, 2009
#3
Wow, that's great Karel, thank you very much for the information!
Jérôme Jaglale
Apr 26, 2009
#4
Hey, I met this problem:
Warning: Missing config cascade for "smileys" in /public_html/wiki/dokuwiki/inc/confutils.php on line 198
created:
last Modified:
Do you have any suggestion to fix it?
Aladdin
Nov 11, 2010
#5
Hi,
Great utility, thanks. I got the example to work but when I try it on my site I get errors for missing function calls. It looks like the DS_STORE files contain the needed functions defined. However your DS_STORES do not appear to work with my dokuwiki installation. Is there any information that tells how to create these.
Tom
Jan 11, 2011
#6
.DS_Store files are only Mac OS X system files. You can remove them.
Jérôme Jaglale
Jan 11, 2011
#7
Thanks for the quick reply. I did remove them and your example still worked but mine still did not. I saw that I am running dokuwiki version 2010-11-07. I walked thru the missing includes and added into doc.php the following
require DOKU_PATH . '/inc/pageutils.php';
require DOKU_PATH . '/inc/io.php';
require DOKU_PATH . '/inc/confutils.php';
require DOKU_PATH . '/inc/init.php';
It then worked perfectly. Thanks again, you saved me from wasting time looking into DS_STORE files!
Tom
Jan 11, 2011
#8