Index: trunk/phase3/includes/api/ApiRsd.php |
— | — | @@ -45,15 +45,9 @@ |
46 | 46 | $result->addValue( null, 'version', '1.0' ); |
47 | 47 | $result->addValue( null, 'xmlns', 'http://archipelago.phrasewise.com/rsd' ); |
48 | 48 | |
49 | | - $service = array( |
50 | | - 'engineName' => array( |
51 | | - '*' => 'MediaWiki' |
52 | | - ), |
53 | | - 'engineLink' => array( |
54 | | - '*' => 'http://www.mediawiki.org/' |
55 | | - ), |
56 | | - 'apis' => $this->formatRsdApiList() |
57 | | - ); |
| 49 | + $service = array( 'apis' => $this->formatRsdApiList() ); |
| 50 | + ApiResult::setContent( $service, 'MediaWiki', 'engineName' ); |
| 51 | + ApiResult::setContent( $service, 'http://www.mediawiki.org/', 'engineLink' ); |
58 | 52 | |
59 | 53 | $result->setIndexedTagName( $service['apis'], 'api' ); |
60 | 54 | |
— | — | @@ -138,12 +132,11 @@ |
139 | 133 | 'name' => $name, |
140 | 134 | 'preferred' => wfBoolToStr( $name == 'MediaWiki' ), |
141 | 135 | 'apiLink' => $info['apiLink'], |
142 | | - 'blogID' => isset( $info['blogID'] ) ? $info['blogID'] : '' |
| 136 | + 'blogID' => isset( $info['blogID'] ) ? $info['blogID'] : '', |
143 | 137 | ); |
| 138 | + $settings = array(); |
144 | 139 | if ( isset( $info['docs'] ) ) { |
145 | | - $data['settings']['docs'] = array( |
146 | | - '*' => $info['docs'], |
147 | | - ); |
| 140 | + ApiResult::setContent( $settings, $info['docs'], 'docs' ); |
148 | 141 | } |
149 | 142 | if ( isset( $info['settings'] ) ) { |
150 | 143 | foreach ( $info['settings'] as $setting => $val ) { |
— | — | @@ -152,14 +145,14 @@ |
153 | 146 | } else { |
154 | 147 | $xmlVal = $val; |
155 | 148 | } |
156 | | - $data['settings'][] = array( |
157 | | - 'name' => $setting, |
158 | | - '*' => $xmlVal, |
159 | | - ); |
| 149 | + $setting = array( 'name' => $setting ); |
| 150 | + ApiResult::setContent( $setting, $xmlVal ); |
| 151 | + $settings[] = $setting; |
160 | 152 | } |
161 | 153 | } |
162 | | - if ( isset( $data['settings'] ) ) { |
163 | | - $data['settings']['_element'] = 'setting'; |
| 154 | + if ( count( $settings ) ) { |
| 155 | + $this->getResult()->setIndexedTagName( $settings, 'setting' ); |
| 156 | + $data['settings'] = $settings; |
164 | 157 | } |
165 | 158 | $outputData[] = $data; |
166 | 159 | } |