4 * Output class modelled on OutputPage.
6 * I've opted to use a distinct class rather than derive from OutputPage here in
7 * the interests of separation of concerns: if we used a subclass, there would be
8 * quite a lot of things you could do in OutputPage that would break the installer,
9 * that wouldn't be immediately obvious.
11 class CliInstallerOutput
{
13 function __construct( $parent ) {
14 $this->parent
= $parent;
17 function addHTML( $html ) {
18 $this->contents
.= $html;
21 function addWikiText( $text ) {
22 $this->addHTML( $this->parent
->parse( $text ) );
25 function addHTMLNoFlush( $html ) {
26 $this->contents
.= $html;
29 function addWarning( $msg ) {
30 $this->warnings
.= "<p>$msg</p>\n";
33 function addWarningMsg( $msg /*, ... */ ) {
34 $params = func_get_args();
35 array_shift( $params );
36 $this->addWarning( wfMsg( $msg, $params ) );
39 function redirect( $url ) {
40 if ( $this->headerDone
) {
41 throw new MWException( __METHOD__
. ' called after sending headers' );
43 $this->redirectTarget
= $url;
50 function useShortHeader( $use = true ) {
54 echo html_entity_decode( strip_tags( $this->contents
), ENT_QUOTES
);
61 if( !is_object( $wgLang ) ||
!$wgLang->isRtl() )
67 function getLanguageCode() {
69 if( !is_object( $wgLang ) )
72 return $wgLang->getCode();
75 function outputWarnings() {
76 $this->addHTML( $this->warnings
);