no longer store ADOdb object in session, also ensures reevaluating environment-data or multiple hosts in connection-data

This commit is contained in:
Ralf Becker 2015-10-07 19:33:22 +00:00
parent 0e7a5338f0
commit 51b60c5df6

View File

@ -584,6 +584,24 @@ class egw_db
$this->connect(); // we need to re-connect
}
/**
* Magic method called when object get's serialized
*
* We do NOT store Link_ID and private_Link_ID, as we need to reconnect anyway.
* This also ensures reevaluating environment-data or multiple hosts in connection-data!
*
* @return array
*/
function __sleep()
{
if (!empty($this->setupType)) $this->Type = $this->setupType; // restore Type eg. to mysqli
$vars = get_object_vars($this);
unset($vars['Link_ID']);
unset($vars['privat_Link_ID']);
return array_keys($vars);
}
/**
* changes defaults set in class-var $capabilities depending on db-type and -version
*
@ -639,7 +657,7 @@ class egw_db
unset($this->Link_ID);
$this->Link_ID = 0;
if (!empty($this->setupType)) $this->type = $this->setupType;
if (!empty($this->setupType)) $this->Type = $this->setupType;
}
/**