* remove bogus outputFooter call
[lhc/web/wiklou.git] / includes / installer / CliInstallerOutput.php
1 <?php
2
3 /**
4 * Output class modelled on OutputPage.
5 *
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.
10 */
11 class CliInstallerOutput {
12
13 function __construct( $parent ) {
14 $this->parent = $parent;
15 }
16
17 function addHTML( $html ) {
18 $this->contents .= $html;
19 }
20
21 function addWikiText( $text ) {
22 $this->addHTML( $this->parent->parse( $text ) );
23 }
24
25 function addHTMLNoFlush( $html ) {
26 $this->contents .= $html;
27 }
28
29 function addWarning( $msg ) {
30 $this->warnings .= "<p>$msg</p>\n";
31 }
32
33 function addWarningMsg( $msg /*, ... */ ) {
34 $params = func_get_args();
35 array_shift( $params );
36 $this->addWarning( wfMsg( $msg, $params ) );
37 }
38
39 function redirect( $url ) {
40 if ( $this->headerDone ) {
41 throw new MWException( __METHOD__ . ' called after sending headers' );
42 }
43 $this->redirectTarget = $url;
44 }
45
46 function output() {
47 $this->flush();
48 }
49
50 function useShortHeader( $use = true ) {
51 }
52
53 function flush() {
54 echo html_entity_decode( strip_tags( $this->contents ), ENT_QUOTES );
55 flush();
56 $this->contents = '';
57 }
58
59 function getDir() {
60 global $wgLang;
61 if( !is_object( $wgLang ) || !$wgLang->isRtl() )
62 return 'ltr';
63 else
64 return 'rtl';
65 }
66
67 function getLanguageCode() {
68 global $wgLang;
69 if( !is_object( $wgLang ) )
70 return 'en';
71 else
72 return $wgLang->getCode();
73 }
74
75 function outputWarnings() {
76 $this->addHTML( $this->warnings );
77 $this->warnings = '';
78 }
79 }