From: [EMAIL PROTECTED] Operating system: Linux/Win2k/whatever PHP version: 4.1.2 PHP Bug Type: Feature/Change Request Bug description: class loading in unserialize/session_decode
I define classes in extra scripts like this one: File: hello.class.php <? class Hello { function print() { echo "Hello"; } } ?> I include and create them via a manufacturing function: $obj = myCreateObject("Hello"); myCreateObject lookup the file for Hello, include_once them, create the object and returns it. But then the problem: I store the object to session and when I unserialize the object in the next script, an error occurs. Clear, the class script file isn't loaded. Until now I do the serialize/unserialize via a trick (a register_shutdown_function store all of these objects AND their meta data like classname in one session var and in the next script all of them are unserialized manually). My Question: Is in the unserialize function and/or the session_decode function a possibility of a callback function like myLoadClass("Hello") for a serialized object (class Hello) ? And if the answer is a no: Hey PHP team it's an idea for a new function. ps I post this message already in the zend.com forum PHP into future -- Edit bug report at http://bugs.php.net/?id=16591&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16591&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16591&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16591&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16591&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16591&r=support Expected behavior: http://bugs.php.net/fix.php?id=16591&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16591&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16591&r=submittedtwice