ZF-4053: Silence cycle exception in Zend_Json_Encoder
I need a way to silence the exception thrown when cycle detection is switched on and one is detected in Zend_Json_Encoder.
This relates to issue ZF-4040.
The aim is to still generate a valid JSON string even if cycles are detected. In place of the repeated object we could insert
"* RECURSION ([Class Name]) *"
into the JSON string.
To accomplish this we could use:
protected function __construct($cycleCheck = false, $silenceCycleCheck = false)
or convert $_cycleCheck to an integer and introduce a Zend_Json_Encoder::SILENT_CYCLE_CHECK constant to avoid a new constructor/method argument.