cpliakas/acquia-sdk-php — pull request #17 by webbj74 (2013-12-07 19:10:11+00:00)
Title: Fixes compatibility issue in Acquia\Common\Json between PHP 5.3 and PHP 5.4+ 

PHP 5.3 lacks JSON_PRETTY_PRINT and JSON_UNESCAPED_SLASHES. This means that consumers of this class will need to handle different output. This is less a problem for JSON_PRETTY_PRINT, and more a problem for JSON_UNESCAPED_SLASHES, which affects the actual value returned.

To work around this I've added a pretty_print static method. This method will strip escaped slashes on PHP 5.3, and will format the JSON (if it isn't already).

I've included unit tests for encoding & decoding with a JSON test pattern which should cover all of the json_encode options.