https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112751

Revision: 112751
Author:   reedy
Date:     2012-03-01 01:17:55 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
Don't explicitly use Services_JSON, use FormatJson

Modified Paths:
--------------
    trunk/extensions/CategoryTree/CategoryTreeFunctions.php

Modified: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
===================================================================
--- trunk/extensions/CategoryTree/CategoryTreeFunctions.php     2012-03-01 
01:07:18 UTC (rev 112750)
+++ trunk/extensions/CategoryTree/CategoryTreeFunctions.php     2012-03-01 
01:17:55 UTC (rev 112751)
@@ -239,19 +239,6 @@
        }
 
        /**
-        * @return Services_JSON
-        */
-       static function getJsonCodec() {
-               static $json = null;
-
-               if ( !$json ) {
-                       $json = new Services_JSON(); # recycle API's JSON codec 
implementation
-               }
-
-               return $json;
-       }
-
-       /**
         * @param $options
         * @param $enc
         * @return mixed
@@ -261,8 +248,7 @@
                if ( $enc == 'mode' || $enc == '' ) {
                        $opt = $options['mode'];
                } elseif ( $enc == 'json' ) {
-                       $json = self::getJsonCodec(); // XXX: this may be a bit 
heavy...
-                       $opt = $json->encode( $options );
+                       $opt = FormatJson::encode( $options );
                } else {
                        throw new MWException( 'Unknown encoding for 
CategoryTree options: ' . $enc );
                }
@@ -280,8 +266,7 @@
                if ( $enc == 'mode' || $enc == '' ) {
                        $opt = array( "mode" => $options );
                } elseif ( $enc == 'json' ) {
-                       $json = self::getJsonCodec(); // XXX: this may be a bit 
heavy...
-                       $opt = $json->decode( $options );
+                       $opt = FormatJson::decode( $options );
                        $opt = get_object_vars( $opt );
                } else {
                        throw new MWException( 'Unknown encoding for 
CategoryTree options: ' . $enc );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to