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:41:09 +00:00
parent f7e1c73133
commit fdc5e65d4d

View File

@ -590,6 +590,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
*
@ -645,7 +663,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;
}
/**