https://bugzilla.wikimedia.org/show_bug.cgi?id=20336
Brion Vibber <br...@wikimedia.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |br...@wikimedia.org --- Comment #4 from Brion Vibber <br...@wikimedia.org> 2009-08-23 01:06:57 UTC --- We've got a fair number of places using ApiFormatJson::getJsonEncode() right now (a wrapper which checks if json_encode is present and non-buggy, then runs either through json_encode or the Services_JSON class) but there's no equivalent wrapper for decoding. I would probably recommend breaking our Services_JSON copy out of the api dir and have nice global wrapper methods for both encoding and decoding which aren't API-specific... (Using a class static method is friendly to the autoloader and means we don't have to worry about defining the function if we're not going to use it; it also avoids worrying about whether we're going to break something else that sees our fake json_encode() and thinks that something else is available which isn't.) Note that our preexisting Xml::encodeJsVar() is basically a simple JSON encoder as well (though currently it produces extra spacing and doesn't handle associative arrays right). We should probably merge some of these things together... Xml::jsonEncode() and Xml::jsonDecode() maybe? Or we could break them out to a new class with a nice clean name... FormatJson::encode() and FormatJson::decode() ? -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l