Serialize() doesn't serialize objects recursively?
| From: | Yev | Date: | Wed, 20 Dec 2000 02:05:24 +0000 |
| Subject: | Serialize() doesn't serialize objects recursively? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31121@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to serialize() the following class:
This is a snippet:
class Auth {
var $dbh;
var $name;
var $sessionkey;
var $lifetime; # in minutes
var $authenticated;
var $expired;
var $auth_url;
function Auth($name, $auth_url) {
global $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS, $HTTP_GET_VARS;
$this->dbh = new Auth_DB();
$this->name = $name;
$this->sessionkey = $HTTP_COOKIE_VARS["SESSIONID"];
$this->lifetime = 15;
$this->authenticated = false;
$this->expired = false;
$this->auth_url = $auth_url;
$this->register();
}
......
The serialize() doesn't seem to preserve the value of $dbh (an object
itself)
So, if unserialize(), I can't seem to use any methods for $dbh, I get
an error:
Fatal error: Call to a member function on a non-object in
/usr/local/phplib72c/php/auth2.inc
Any suggestions?
Thanks
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/