john Tue Nov 19 21:45:02 2002 EDT
Modified files:
/phpdoc/en/reference/var/functions serialize.xml unserialize.xml
Log:
Documented the __sleep and __wakeup member functions when
serializing/unserializing objects in both function references.
Index: phpdoc/en/reference/var/functions/serialize.xml
diff -u phpdoc/en/reference/var/functions/serialize.xml:1.2
phpdoc/en/reference/var/functions/serialize.xml:1.3
--- phpdoc/en/reference/var/functions/serialize.xml:1.2 Wed Apr 17 02:44:59 2002
+++ phpdoc/en/reference/var/functions/serialize.xml Tue Nov 19 21:45:02 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/var.xml, last change in rev 1.28 -->
<refentry id="function.serialize">
<refnamediv>
@@ -30,6 +30,13 @@
You can even <function>serialize</function> arrays that contain
references to itself. References inside the array/object you
are <function>serialize</function>ing will also be stored.
+ </simpara>
+ <simpara>
+ When serializing objects, PHP will attempt to call the member function
+__sleep() prior to serialization. This is to allow the object to do any
+last minute clean-up, etc. prior to being serialized. Likewise, when the
+object is restored using <function>unserialize</function> the __wakeup()
+member function is called.
</simpara>
<!-- TODO
in 4.0.4pl1 this didn't work properly, however, there
Index: phpdoc/en/reference/var/functions/unserialize.xml
diff -u phpdoc/en/reference/var/functions/unserialize.xml:1.6
phpdoc/en/reference/var/functions/unserialize.xml:1.7
--- phpdoc/en/reference/var/functions/unserialize.xml:1.6 Tue Nov 19 21:29:56
2002
+++ phpdoc/en/reference/var/functions/unserialize.xml Tue Nov 19 21:45:02 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/var.xml, last change in rev 1.2 -->
<refentry id="function.unserialize">
<refnamediv>
@@ -37,6 +37,7 @@
</para>
</note>
<para>
+ If the variable being unserialized is an object, after successfully
+reconstructing the object PHP will automatically attempt to call the __wakeup()
+member function (if it exists).
<example>
<title>unserialize_callback_func example</title>
<programlisting role="php">
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php