summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-04-16 19:17:33 +0200
committerandi <andi@splitbrain.org>2005-04-16 19:17:33 +0200
commitc112d57805d6740c6e0a200fd5fd3f2717f86c69 (patch)
treeedd52d6bd546cb2600af82c1d354360a968ef3c7 /inc
parentf54a290c82dea42a1006c3e79b9d55455f424381 (diff)
downloadrpg-c112d57805d6740c6e0a200fd5fd3f2717f86c69.tar.gz
rpg-c112d57805d6740c6e0a200fd5fd3f2717f86c69.tar.bz2
new parser now default, caching added
darcs-hash:20050416171733-9977f-61a66a56862c4126c6987cdc19609b4e5504da9b.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/common.php59
-rw-r--r--inc/format.php2
-rw-r--r--inc/html.php37
-rw-r--r--inc/io.php2
-rw-r--r--inc/parser.php2
-rw-r--r--inc/parser/action.php109
-rw-r--r--inc/parserutils.php240
7 files changed, 265 insertions, 186 deletions
diff --git a/inc/common.php b/inc/common.php
index 9223b22e4..6d0a28ebb 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -11,6 +11,7 @@
require_once(DOKU_INC.'inc/io.php');
require_once(DOKU_INC.'inc/utf8.php');
require_once(DOKU_INC.'inc/mail.php');
+ require_once(DOKU_INC.'inc/parserutils.php');
/**
* Return info about the current document as associative
@@ -46,6 +47,7 @@ function pageinfo(){
$REV = '';
}
}
+ $info['rev'] = $REV;
if($info['exists']){
$info['writable'] = (is_writable($info['filepath']) &&
($info['perm'] >= AUTH_EDIT));
@@ -359,23 +361,6 @@ function formText($text){
}
/**
- * Returns the specified local text in parsed format
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function parsedLocale($id){
- //disable section editing
- global $parser;
- $se = $parser['secedit'];
- $parser['secedit'] = false;
- //fetch parsed locale
- $html = io_cacheParse(localeFN($id));
- //reset section editing
- $parser['secedit'] = $se;
- return $html;
-}
-
-/**
* Returns the specified local text in raw format
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -384,46 +369,6 @@ function rawLocale($id){
return io_readFile(localeFN($id));
}
-
-/**
- * Returns the parsed Wikitext for the given id and revision.
- *
- * If $excuse is true an explanation is returned if the file
- * wasn't found
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function parsedWiki($id,$rev='',$excuse=true){
- $file = wikiFN($id,$rev);
- $ret = '';
-
- //ensure $id is in global $ID (needed for parsing)
- global $ID;
- $ID = $id;
-
- if($rev){
- if(@file_exists($file)){
- $ret = parse(io_readFile($file));
- }elseif($excuse){
- $ret = parsedLocale('norev');
- }
- }else{
- if(@file_exists($file)){
- if(!defined('DOKU_USENEWPARSER')){
- $ret = io_cacheParse($file);
- }else{
- msg('using new parser');
- require_once(DOKU_INC.'inc/parser/action.php');
- $ret = render_as_xhtml(parse_to_instructions(io_readFile($file)));
- }
- }elseif($excuse){
- $ret = parsedLocale('newpage');
- }
- }
-
- return $ret;
-}
-
/**
* Returns the raw WikiText
*
diff --git a/inc/format.php b/inc/format.php
index d703d78ad..0a20b566c 100644
--- a/inc/format.php
+++ b/inc/format.php
@@ -7,6 +7,8 @@
* @deprecated part of the XHTML renderer
*/
+trigger_error('deprecated parser.php included');
+
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
require_once(DOKU_INC.'conf/dokuwiki.php');
require_once(DOKU_INC.'inc/common.php');
diff --git a/inc/html.php b/inc/html.php
index 70ebc1f76..8cac264b1 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -7,7 +7,6 @@
*/
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
- require_once(DOKU_INC.'inc/format.php');
/**
* Convenience function to quickly build a wikilink
@@ -52,7 +51,7 @@ function html_login(){
global $conf;
global $ID;
- print parsedLocale('login');
+ print p_locale_xhtml('login');
?>
<div align="center">
<form action="<?=script()?>" accept-charset="<?=$lang['encoding']?>" method="post">
@@ -144,7 +143,7 @@ function html_secedit_button($section,$p){
*/
function html_secedit($text,$show=true){
global $INFO;
- if($INFO['writable'] && $show){
+ if($INFO['writable'] && $show && !$INFO['rev']){
$text = preg_replace('#<!-- SECTION \[(\d+-\d+)\] -->#e',
"html_secedit_button('\\1',true)",
$text);
@@ -270,13 +269,13 @@ function html_show($text=''){
if ($text){
//PreviewHeader
- print parsedLocale('preview');
+ print p_locale_xhtml('preview');
print '<div class="preview">';
print html_secedit(parse($text),false);
print '</div>';
}else{
- if ($REV) print parsedLocale('showrev');
- $html = parsedWiki($ID,$REV,true);
+ if ($REV) print p_locale_xhtml('showrev');
+ $html = p_wiki_xhtml($ID,$REV,true);
$html = html_secedit($html);
print html_hilight($html,$HIGH);
}
@@ -308,7 +307,7 @@ function html_search(){
global $ID;
global $lang;
- print parsedLocale('searchpage');
+ print p_locale_xhtml('searchpage');
flush();
//show progressbar
@@ -372,7 +371,7 @@ function html_locked($ip){
$expire = @date($conf['dformat'], $locktime + $conf['locktime'] );
$min = round(($conf['locktime'] - (time() - $locktime) )/60);
- print parsedLocale('locked');
+ print p_locale_xhtml('locked');
print '<ul>';
print '<li><b>'.$lang['lockedby'].':</b> '.$ip.'</li>';
print '<li><b>'.$lang['lockexpire'].':</b> '.$expire.' ('.$min.' min)</li>';
@@ -392,7 +391,7 @@ function html_revisions(){
$revisions = getRevisions($ID);
$date = @date($conf['dformat'],$INFO['lastmod']);
- print parsedLocale('revisions');
+ print p_locale_xhtml('revisions');
print '<ul>';
if($INFO['exists']){
print '<li>';
@@ -437,7 +436,7 @@ function html_recent(){
global $conf;
$recents = getRecents(0,true);
- print parsedLocale('recent');
+ print p_locale_xhtml('recent');
print '<ul>';
foreach(array_keys($recents) as $id){
$date = date($conf['dformat'],$recents[$id]['date']);
@@ -470,7 +469,7 @@ function html_index($ns){
}
$ns = utf8_encodeFN(str_replace(':','/',$ns));
- print parsedLocale('index');
+ print p_locale_xhtml('index');
$data = array();
search($data,$conf['datadir'],'search_index',array('ns' => $ns));
@@ -599,7 +598,7 @@ function html_backlinks(){
$opts['name'] = $ID;
}
- print parsedLocale('backlinks');
+ print p_locale_xhtml('backlinks');
$data = array();
search($data,$conf['datadir'],'search_backlinks',$opts);
@@ -642,7 +641,7 @@ function html_diff($text='',$intro=true){
$lang['current'];
}
$tdf = new TableDiffFormatter();
- if($intro) print parsedLocale('diff');
+ if($intro) print p_locale_xhtml('diff');
?>
<table class="diff" width="100%">
<tr>
@@ -667,7 +666,7 @@ function html_conflict($text,$summary){
global $ID;
global $lang;
- print parsedLocale('conflict');
+ print p_locale_xhtml('conflict');
?>
<form name="editform" method="post" action="<?=script()?>" accept-charset="<?=$lang['encoding']?>">
<input type="hidden" name="id" value="<?=$ID?>" />
@@ -709,7 +708,7 @@ function html_register(){
global $lang;
global $ID;
- print parsedLocale('register');
+ print p_locale_xhtml('register');
?>
<div align="center">
<form name="register" method="post" action="<?=wl($ID)?>" accept-charset="<?=$lang['encoding']?>">
@@ -776,10 +775,10 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
$wr = $INFO['writable'];
if($wr){
- if ($REV) print parsedLocale('editrev');
- print parsedLocale($include);
+ if ($REV) print p_locale_xhtml('editrev');
+ print p_locale_xhtml($include);
}else{
- print parsedLocale('read');
+ print p_locale_xhtml('read');
$ro='readonly="readonly"';
}
if(!$DATE) $DATE = $INFO['lastmod'];
@@ -952,7 +951,7 @@ function html_admin(){
global $ID;
global $lang;
- print parsedLocale('admin');
+ print p_locale_xhtml('admin');
ptln('<ul class="admin">');
diff --git a/inc/io.php b/inc/io.php
index b0b834f9d..f62dba88b 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -8,13 +8,13 @@
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
require_once(DOKU_INC.'inc/common.php');
- require_once(DOKU_INC.'inc/parser.php');
/**
* Returns the parsed text from the given sourcefile. Uses cache
* if exists. Creates it if not.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @deprecated -> parserutils
*/
function io_cacheParse($file){
global $conf;
diff --git a/inc/parser.php b/inc/parser.php
index 4854ac0fb..8f4a188b7 100644
--- a/inc/parser.php
+++ b/inc/parser.php
@@ -7,6 +7,8 @@
* @deprecated replaced by the new parser
*/
+trigger_error('deprecated parser.php included');
+
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
include_once(DOKU_INC.'inc/common.php');
include_once(DOKU_INC.'inc/html.php');
diff --git a/inc/parser/action.php b/inc/parser/action.php
deleted file mode 100644
index 4426c1ac5..000000000
--- a/inc/parser/action.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-/**
- *
- * @todo maybe wrap in class
- * @todo rename to helper
- */
-
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
-
-require_once(DOKU_INC.'inc/confutils.php');
-
-/**
- * turns a page into a list of instructions
- *
- * @author Harry Fuecks <hfuecks@gmail.com>
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function parse_to_instructions($text){
- global $conf;
-
- require_once DOKU_INC . 'inc/parser/parser.php';
-
- // Create the parser
- $Parser = & new Doku_Parser();
-
- // Add the Handler
- $Parser->Handler = & new Doku_Handler();
-
- // Load all the modes
- $Parser->addMode('listblock',new Doku_Parser_Mode_ListBlock());
- $Parser->addMode('preformatted',new Doku_Parser_Mode_Preformatted());
- $Parser->addMode('notoc',new Doku_Parser_Mode_NoToc());
- $Parser->addMode('header',new Doku_Parser_Mode_Header());
- $Parser->addMode('table',new Doku_Parser_Mode_Table());
-
- $formats = array (
- 'strong', 'emphasis', 'underline', 'monospace',
- 'subscript', 'superscript', 'deleted',
- );
- foreach ( $formats as $format ) {
- $Parser->addMode($format,new Doku_Parser_Mode_Formatting($format));
- }
-
- $Parser->addMode('linebreak',new Doku_Parser_Mode_Linebreak());
- $Parser->addMode('footnote',new Doku_Parser_Mode_Footnote());
- $Parser->addMode('hr',new Doku_Parser_Mode_HR());
-
- $Parser->addMode('unformatted',new Doku_Parser_Mode_Unformatted());
- $Parser->addMode('php',new Doku_Parser_Mode_PHP());
- $Parser->addMode('html',new Doku_Parser_Mode_HTML());
- $Parser->addMode('code',new Doku_Parser_Mode_Code());
- $Parser->addMode('file',new Doku_Parser_Mode_File());
- $Parser->addMode('quote',new Doku_Parser_Mode_Quote());
-
- $Parser->addMode('smiley',new Doku_Parser_Mode_Smiley(array_keys(getSmileys())));
- $Parser->addMode('acronym',new Doku_Parser_Mode_Acronym(array_keys(getAcronyms())));
- #$Parser->addMode('wordblock',new Doku_Parser_Mode_Wordblock(getBadWords()));
- $Parser->addMode('entity',new Doku_Parser_Mode_Entity(array_keys(getEntities())));
-
- $Parser->addMode('multiplyentity',new Doku_Parser_Mode_MultiplyEntity());
- $Parser->addMode('quotes',new Doku_Parser_Mode_Quotes());
-
- if($conf['camelcase']){
- $Parser->addMode('camelcaselink',new Doku_Parser_Mode_CamelCaseLink());
- }
-
- $Parser->addMode('internallink',new Doku_Parser_Mode_InternalLink());
- $Parser->addMode('rss',new Doku_Parser_Mode_RSS());
- $Parser->addMode('media',new Doku_Parser_Mode_Media());
- $Parser->addMode('externallink',new Doku_Parser_Mode_ExternalLink());
- $Parser->addMode('email',new Doku_Parser_Mode_Email());
- $Parser->addMode('windowssharelink',new Doku_Parser_Mode_WindowsShareLink());
- //$Parser->addMode('filelink',new Doku_Parser_Mode_FileLink()); //FIXME ???
- $Parser->addMode('eol',new Doku_Parser_Mode_Eol());
-
- // Do the parsing
- return $Parser->parse($text);
-}
-
-/**
- * Renders a list of instruction to XHTML
- *
- * @author Harry Fuecks <hfuecks@gmail.com>
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function render_as_xhtml($instructions){
-
-#dbg($instructions);
-
- // Create the renderer
- require_once DOKU_INC . 'inc/parser/xhtml.php';
- $Renderer = & new Doku_Renderer_XHTML();
-
- $Renderer->smileys = getSmileys();
- $Renderer->entities = getEntities();
- $Renderer->acronyms = getAcronyms();
- $Renderer->interwiki = getInterwiki();
- #$Renderer->badwords = getBadWords();
-
- // Loop through the instructions
- foreach ( $instructions as $instruction ) {
- // Execute the callback against the Renderer
- call_user_func_array(array(&$Renderer, $instruction[0]),$instruction[1]);
- }
- // Return the output
- return $Renderer->doc;
-}
-
-//Setup VIM: ex: et ts=2 enc=utf-8 :
diff --git a/inc/parserutils.php b/inc/parserutils.php
new file mode 100644
index 000000000..efda5c85b
--- /dev/null
+++ b/inc/parserutils.php
@@ -0,0 +1,240 @@
+<?php
+/**
+ * Utilities for collecting data from config files
+ *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+
+ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
+
+ require_once(DOKU_INC.'inc/confutils.php');
+ require_once(DOKU_INC.'inc/pageutils.php');
+
+/**
+ * Returns the parsed Wikitext in XHTML for the given id and revision.
+ *
+ * If $excuse is true an explanation is returned if the file
+ * wasn't found
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function p_wiki_xhtml($id, $rev='', $excuse=true){
+ $file = wikiFN($id,$rev);
+ $ret = '';
+
+ //ensure $id is in global $ID (needed for parsing)
+ global $ID;
+ $ID = $id;
+
+ if($rev){
+ if(@file_exists($file)){
+ $ret = p_render_xhtml(p_get_instructions($file)); //no caching on old revisions
+ }elseif($excuse){
+ $ret = p_locale_xhtml('norev');
+ }
+ }else{
+ if(@file_exists($file)){
+ $ret = p_cached_xhtml($file);
+ }elseif($excuse){
+ $ret = p_locale_xhtml('newpage');
+ }
+ }
+
+ return $ret;
+}
+
+/**
+ * Returns the specified local text in parsed format
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function p_locale_xhtml($id){
+ //fetch parsed locale
+ $html = p_cached_xhtml(localeFN($id));
+ return $html;
+}
+
+/**
+ * Returns the given file parsed to XHTML
+ *
+ * Uses and creates a cachefile
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function p_cached_xhtml($file){
+ global $conf;
+ $cache = $conf['datadir'].'/_cache/xhtml/';
+ $cache .= md5($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT']);
+
+ // check if cache can be used
+ $cachetime = @filemtime($cache); // 0 if not exists
+
+ if( @file_exists($file) // does the source exist
+ && $cachetime > @filemtime($file) // cache is fresh
+ && ((time() - $cachetime) < $conf['cachetime']) // and is cachefile young enough
+ && !isset($_REQUEST['purge']) // no purge param was set
+
+ && ($cachetime > @filemtime(DOKU_INC.'conf/dokuwiki.php')) // newer than the config file
+ && ($cachetime > @filemtime(DOKU_INC.'conf/local.php')) // newer than the local config file
+ && ($cachetime > @filemtime(DOKU_INC.'inc/parser/xhtml.php')) // newer than the renderer
+ && ($cachetime > @filemtime(DOKU_INC.'inc/parser/parser.php')) // newer than the parser
+ && ($cachetime > @filemtime(DOKU_INC.'inc/parser/handler.php')))// newer than the handler
+ {
+ //well then use the cache
+ $parsed = io_readfile($cache);
+ $parsed .= "\n<!-- cachefile $cache used -->\n";
+ }else{
+ $parsed = p_render_xhtml(p_cached_instructions($file)); //try to use cached instructions
+ io_saveFile($cache,$parsed); //save cachefile
+ $parsed .= "\n<!-- no cachefile used, but created -->\n";
+
+ /* FIXME add nocache directive handling like this:
+ if($parser['cache']){
+ io_saveFile($cache,$parsed); //save cachefile
+ $parsed .= "\n<!-- no cachefile used, but created -->\n";
+ }else{
+ @unlink($cache); //try to delete cachefile
+ $parsed .= "\n<!-- no cachefile used, caching forbidden -->\n";
+ }
+ */
+ }
+
+ return $parsed;
+}
+
+/**
+ * Returns the render instructions for a file
+ *
+ * Uses and creates a serialized cache file
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function p_cached_instructions($file){
+ global $conf;
+ $cache = $conf['datadir'].'/_cache/instructions/';
+ $cache .= md5($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT']);
+
+ // check if cache can be used
+ $cachetime = @filemtime($cache); // 0 if not exists
+
+ if( @file_exists($file) // does the source exist
+ && $cachetime > @filemtime($file) // cache is fresh
+ && !isset($_REQUEST['purge']) // no purge param was set
+ && ($cachetime > @filemtime(DOKU_INC.'conf/dokuwiki.php')) // newer than the config file
+ && ($cachetime > @filemtime(DOKU_INC.'conf/local.php')) // newer than the local config file
+ && ($cachetime > @filemtime(DOKU_INC.'inc/parser/parser.php')) // newer than the parser
+ && ($cachetime > @filemtime(DOKU_INC.'inc/parser/handler.php')))// newer than the handler
+ {
+ //well then use the cache
+ return unserialize(io_readfile($cache));
+ }elseif(@file_exists($file)){
+ // no cache - do some work
+ $ins = p_get_instructions($file);
+ io_savefile($cache,serialize($ins));
+ return $ins;
+ }
+
+ return NULL;
+}
+
+/**
+ * turns a page into a list of instructions
+ *
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function p_get_instructions($file){
+ global $conf;
+
+ $text = io_readfile($file);
+
+ require_once DOKU_INC . 'inc/parser/parser.php';
+
+ // Create the parser
+ $Parser = & new Doku_Parser();
+
+ // Add the Handler
+ $Parser->Handler = & new Doku_Handler();
+
+ // Load all the modes
+ $Parser->addMode('listblock',new Doku_Parser_Mode_ListBlock());
+ $Parser->addMode('preformatted',new Doku_Parser_Mode_Preformatted());
+ $Parser->addMode('notoc',new Doku_Parser_Mode_NoToc());
+ $Parser->addMode('header',new Doku_Parser_Mode_Header());
+ $Parser->addMode('table',new Doku_Parser_Mode_Table());
+
+ $formats = array (
+ 'strong', 'emphasis', 'underline', 'monospace',
+ 'subscript', 'superscript', 'deleted',
+ );
+ foreach ( $formats as $format ) {
+ $Parser->addMode($format,new Doku_Parser_Mode_Formatting($format));
+ }
+
+ $Parser->addMode('linebreak',new Doku_Parser_Mode_Linebreak());
+ $Parser->addMode('footnote',new Doku_Parser_Mode_Footnote());
+ $Parser->addMode('hr',new Doku_Parser_Mode_HR());
+
+ $Parser->addMode('unformatted',new Doku_Parser_Mode_Unformatted());
+ $Parser->addMode('php',new Doku_Parser_Mode_PHP());
+ $Parser->addMode('html',new Doku_Parser_Mode_HTML());
+ $Parser->addMode('code',new Doku_Parser_Mode_Code());
+ $Parser->addMode('file',new Doku_Parser_Mode_File());
+ $Parser->addMode('quote',new Doku_Parser_Mode_Quote());
+
+ $Parser->addMode('smiley',new Doku_Parser_Mode_Smiley(array_keys(getSmileys())));
+ $Parser->addMode('acronym',new Doku_Parser_Mode_Acronym(array_keys(getAcronyms())));
+ #$Parser->addMode('wordblock',new Doku_Parser_Mode_Wordblock(getBadWords()));
+ $Parser->addMode('entity',new Doku_Parser_Mode_Entity(array_keys(getEntities())));
+
+ $Parser->addMode('multiplyentity',new Doku_Parser_Mode_MultiplyEntity());
+ $Parser->addMode('quotes',new Doku_Parser_Mode_Quotes());
+
+ if($conf['camelcase']){
+ $Parser->addMode('camelcaselink',new Doku_Parser_Mode_CamelCaseLink());
+ }
+
+ $Parser->addMode('internallink',new Doku_Parser_Mode_InternalLink());
+ $Parser->addMode('rss',new Doku_Parser_Mode_RSS());
+ $Parser->addMode('media',new Doku_Parser_Mode_Media());
+ $Parser->addMode('externallink',new Doku_Parser_Mode_ExternalLink());
+ $Parser->addMode('email',new Doku_Parser_Mode_Email());
+ $Parser->addMode('windowssharelink',new Doku_Parser_Mode_WindowsShareLink());
+ //$Parser->addMode('filelink',new Doku_Parser_Mode_FileLink()); //FIXME ???
+ $Parser->addMode('eol',new Doku_Parser_Mode_Eol());
+
+ // Do the parsing
+ return $Parser->parse($text);
+}
+
+/**
+ * Renders a list of instruction to XHTML
+ *
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function p_render_xhtml($instructions){
+ if(is_null($instructions)) return '';
+
+ // Create the renderer
+ require_once DOKU_INC . 'inc/parser/xhtml.php';
+ $Renderer = & new Doku_Renderer_XHTML();
+
+ $Renderer->smileys = getSmileys();
+ $Renderer->entities = getEntities();
+ $Renderer->acronyms = getAcronyms();
+ $Renderer->interwiki = getInterwiki();
+ #$Renderer->badwords = getBadWords();
+
+ // Loop through the instructions
+ foreach ( $instructions as $instruction ) {
+ // Execute the callback against the Renderer
+ call_user_func_array(array(&$Renderer, $instruction[0]),$instruction[1]);
+ }
+ // Return the output
+ return $Renderer->doc;
+}
+
+//Setup VIM: ex: et ts=2 enc=utf-8 :