Hello Community,
with CMSimple_XH 1.6 we introduced XH_encodeJson(), XH_decodeJson() and XH_lastJsonError(), which offered fallbacks for json_encode(), json_decode resp. json_last_error(). As the latter three functions are only available as part of the JSON extension, which has been bundled with PHP only since 5.2.0 (json_last_error() only since PHP 5.3.0) that made sense.
However, CMSimple_XH 1.7 will require PHP 5.3+, and the fallbacks rely on XH_JSON, which is very slow, has several limitations and presumably is still buggy. Therefore I propose to get rid of XH_JSON for CMSimple_XH 1.7. I presume that most PHP 5.3+ installations have the JSON extension enabled, but to verify this it appears to be appropriate to add a respective system check and to remove XH_JSON as soon as possible. If it turns out that the JSON extension is not widely available, we could consider to bring XH_JSON back -- the sooner we're aware of this particular issue, the better.
Futhermore I suggest to keep the XH_*json* functions for backward compatibility with existing extensions, and to deprecate them only with CMSimple_XH 1.8 (resp. 2.0 if there'll be no 1.8) to leave some leeway.
All in all, I propose this patch.
XH 1.7: Remove XH_JSON
XH 1.7: Remove XH_JSON
Christoph M. Becker – Plugins for CMSimple_XH