Commit 41707745 authored by Penny Leach's avatar Penny Leach Committed by Andrew Robert Nicols

Bug #841711: ADODB modification: add __wakeup to connection object

This reconnects to the db after wakeup, as resource types cannot be
serialized and unserialized.

This is necessary for unit tests, phpunit backups and restore globals
between each test.

Change-Id: I160b4c68ac1db0c3c0a3e1aec1b0dc8584763bf9
Signed-off-by: default avatarPenny Leach <penny@mjollnir.org>
Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent 51064b3b
......@@ -11,3 +11,4 @@ Modifications:
- adodb/drivers/adodb-postgres64.inc.php (d6d8884fabc598aec58e633a6a1e258cd07b3da1)
- Add check for valid columns in MetaIndexes function of
adodb/drivers/adodb-postgres64.inc.php (see bug #796102)
- adodb/adodb.inc.php add wakeup suppport (see bug #841711)
......@@ -333,7 +333,7 @@
var $database = ''; /// Name of database to be used.
var $host = ''; /// The hostname of the database server
var $user = ''; /// The username which is used to connect to the database server.
var $password = ''; /// Password for the username. For security, we no longer store it.
private $password = ''; /// Password for the username. This is required for __wakeup
var $debug = false; /// if set to true will output sql statements
var $maxblobsize = 262144; /// maximum size of blobs or large text fields (262144 = 256K)-- some db's die otherwise like foxpro
var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase
......@@ -514,7 +514,7 @@
{
if ($argHostname != "") $this->host = $argHostname;
if ($argUsername != "") $this->user = $argUsername;
if ($argPassword != "") $this->password = 'not stored'; // not stored for security reasons
if ($argPassword != "") $this->password = $argPassword;
if ($argDatabaseName != "") $this->database = $argDatabaseName;
$this->_isPersistentConnection = false;
......@@ -2705,6 +2705,9 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
return $rs;
}
function __wakeup() {
$this->Connect($this->host, $this->user, $this->password, $this->database, true);
}
} // end class ADOConnection
......@@ -4413,4 +4416,4 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
}
?>
\ No newline at end of file
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment