Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php |
— | — | @@ -239,19 +239,6 @@ |
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
243 | | - * @return Services_JSON |
244 | | - */ |
245 | | - static function getJsonCodec() { |
246 | | - static $json = null; |
247 | | - |
248 | | - if ( !$json ) { |
249 | | - $json = new Services_JSON(); # recycle API's JSON codec implementation |
250 | | - } |
251 | | - |
252 | | - return $json; |
253 | | - } |
254 | | - |
255 | | - /** |
256 | 243 | * @param $options |
257 | 244 | * @param $enc |
258 | 245 | * @return mixed |
— | — | @@ -261,8 +248,7 @@ |
262 | 249 | if ( $enc == 'mode' || $enc == '' ) { |
263 | 250 | $opt = $options['mode']; |
264 | 251 | } elseif ( $enc == 'json' ) { |
265 | | - $json = self::getJsonCodec(); // XXX: this may be a bit heavy... |
266 | | - $opt = $json->encode( $options ); |
| 252 | + $opt = FormatJson::encode( $options ); |
267 | 253 | } else { |
268 | 254 | throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc ); |
269 | 255 | } |
— | — | @@ -280,8 +266,7 @@ |
281 | 267 | if ( $enc == 'mode' || $enc == '' ) { |
282 | 268 | $opt = array( "mode" => $options ); |
283 | 269 | } elseif ( $enc == 'json' ) { |
284 | | - $json = self::getJsonCodec(); // XXX: this may be a bit heavy... |
285 | | - $opt = $json->decode( $options ); |
| 270 | + $opt = FormatJson::decode( $options ); |
286 | 271 | $opt = get_object_vars( $opt ); |
287 | 272 | } else { |
288 | 273 | throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc ); |