Logging: Nesting level too deep - recursive dependency

I recently added a CLogFilter so it would dump out SESSION data.

But started receiving a fatal error with "Nesting level too deep - recursive dependency"on CLogFilter Line 101 when it calls var_export

The issue was a CActiveRecord object stored in the session. All CActiveRecord objects have recursive reference’s.

Taking the example of a Comment model:

Comment[CActiveRecord]->_md[CActiveRecordMetaData]->_model[Comment]->_md[CActiveRecordMetaData]

Here is a print_r of the Comment object (shortened to see the recursion)

Comment Object

(

[verifyCode] => 


[_md:CActiveRecord:private] => CActiveRecordMetaData Object





    [_model:CActiveRecordMetaData:private] => Comment Object


    (


                [verifyCode] => 


                [_md:CActiveRecord:private] => CActiveRecordMetaData Object

RECURSION

Question is how to store CActiveRecord in session and still allow logging since doing so causing a fatal error?

thanks!

Instead of using var_export, try @print_r.

Oh, to store the object in the session, serialize it first.