[dokuwiki] memory exhausted by renderer.php

  • From: freggeln <freggeln@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 12 Jul 2010 13:10:48 +0200

Hi Everybody,

I already posted my question here (http://forum.dokuwiki.org/post/19886) but got the hint to send it directly to the mailing list.

First of all it is not directly related to dokuwiki but to the core components.

I'm just playing around with the components of dokuwiki and using the components to render wiki entries which come from a database.

If I render a small document everything is fine but if I render a larger document which works in my dokuwiki installation without a problem I get the following error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261900 bytes) in C:\xampplite\htdocs\blog\doku\inc\parser\renderer.php on line 279

Event if I set the memory size to 256M I get the same message.

I'm using the following code to render my entry from the database:

#startofcode
if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/doku/');
require_once DOKU_INC . '/inc/parser/parser.php';
require_once DOKU_INC . '/inc/confutils.php';
require_once(DOKU_INC . 'inc/init.php');

$Parser = & new Doku_Parser ();
$Parser->Handler = & new Doku_Handler();

require_once(DOKU_INC . 'inc/parserutils.php');
//print_r (p_get_parsermodes());
$modes = p_get_parsermodes();
foreach($modes as $mode){
    $Parser->addMode($mode['mode'],$mode['obj']);
}
$doc = $vstrPostingText;
$instructions = $Parser->parse($doc);

require_once DOKU_INC . 'inc/parser/xhtml.php';
$Renderer = & new Doku_Renderer_XHTML();
foreach ( $instructions as $instruction ) {

    // Execute the callback against the Renderer
call_user_func_array(array(&$Renderer, $instruction[0]),$instruction[1]);
}
//echo $Renderer->doc;
$vstrPostingTextRendered = $Renderer->doc;
#endofcode

As said I'm just playing around but I really would like to know what I have done wrong.

Thanks in advance.

Regards
--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: