Re: serializing references, almost without modifications
| From: | Kristian Köhntopp | Date: | Fri, 21 Jul 2000 08:47:58 +0000 |
| Subject: | Re: serializing references, almost without modifications | ||
| References: | 1 2 3 4 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-25327@lists.php.net to get a copy of this message | ||
thies@digicol.de wrote:
> hmm - how do you want to serialize resources then
> (db-connections, open-files etc). if the whole argue is about
> completeness you _need_ to take those into consideration!
> also: what happens to "outside" references (references that
> point to variables that are no serialized)?
In general this problem cannot be solved automatically. Some
ressources have a state that cannot be controlled by PHP or
the Zend engine completely. The canonical example is a file
handle ressource refering to a TCP socket. You must write a
__sleep() and __wakeup() function to serialize and unserialize
this ressource properly, and it can be arbitrarily hard to
do this. There is no general solution for this problem
except providing such sleep and wakeup handlers.
Kristian
--
Kristian Köhntopp, NetUSE AG Siemenswall, D-24107 Kiel
Tel: +49 431 386 436 00, Fax: +49 431 386 435 99
Using PHP3? See our web development library at http://phplib.netuse.de/