developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #61: buffer.diff

File buffer.diff, 1.6 KB (added by Lipki, 11 years ago)
  • lib/jelix/core/defaultconfig.ini.php

     
    6464htmlfragment = jResponseHtmlFragment
    6565htmlauth = jResponseHtml
    6666
     67[reponseshtml]
     68buffered_responses = off
     69
    6770[_coreResponses]
    6871html = jResponseHtml
    6972redirect = jResponseRedirect
  • lib/jelix/core/response/jResponseHtml.class.php

     
    167167        $this->doAfterActions();
    168168        if($this->bodyTpl != '')
    169169            $this->body->meta($this->bodyTpl);
    170         $this->outputHtmlHeader();
     170       
     171        if( $GLOBALS['gJConfig']->reponseshtml['buffered'] )
     172             ob_start();
     173        else $this->outputHtmlHeader();
     174       
    171175        echo '<body ';
    172176        foreach($this->bodyTagAttributes as $attr=>$value){
    173177            echo $attr,'="', htmlspecialchars($value),'" ';
     
    222226                echo '}else{alert("there are log messages, you should activate Firebug to see them");}</script>';
    223227            }
    224228        }
    225         echo '</body></html>';
     229        echo '</body>';
     230       
     231        if( $GLOBALS['gJConfig']->reponseshtml['buffered'] )
     232            $body = ob_get_contents();
     233            ob_end_clean();
     234           
     235            $this->outputHtmlHeader();
     236            echo "\r".$body;
     237        }
     238       
     239        echo "\r".'</html>';
    226240        return true;
    227241    }
    228242