@@ 49-61 (lines=13) @@ | ||
46 | } |
|
47 | } |
|
48 | ||
49 | public function getMimeType() { |
|
50 | $data = $this->getResult()->getResultData(); |
|
51 | ||
52 | if ( isset( $data['error'] ) ) { |
|
53 | return $this->errorFallback->getMimeType(); |
|
54 | } |
|
55 | ||
56 | if ( !isset( $data['mime'] ) ) { |
|
57 | ApiBase::dieDebug( __METHOD__, 'No MIME type set for raw formatter' ); |
|
58 | } |
|
59 | ||
60 | return $data['mime']; |
|
61 | } |
|
62 | ||
63 | public function initPrinter( $unused = false ) { |
|
64 | $data = $this->getResult()->getResultData(); |
|
@@ 84-95 (lines=12) @@ | ||
81 | } |
|
82 | } |
|
83 | ||
84 | public function execute() { |
|
85 | $data = $this->getResult()->getResultData(); |
|
86 | if ( isset( $data['error'] ) ) { |
|
87 | $this->errorFallback->execute(); |
|
88 | return; |
|
89 | } |
|
90 | ||
91 | if ( !isset( $data['text'] ) ) { |
|
92 | ApiBase::dieDebug( __METHOD__, 'No text given for raw formatter' ); |
|
93 | } |
|
94 | $this->printText( $data['text'] ); |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * Output HTTP error code 400 when if an error is encountered |