XH 1.7: Remove XH_JSON

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

XH 1.7: Remove XH_JSON

Post by cmb » Mon Mar 02, 2015 11:22 pm

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.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.7: Remove XH_JSON

Post by cmb » Mon Mar 23, 2015 12:39 pm

Done (r1525).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply