Commit c256aeda authored by Penny Leach's avatar Penny Leach Committed by Cecilia Vela Gurovic
Browse files

ADODB modification: add __wakeup to connection object

Bug 1672867

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.

(cherry-picked from 41707745

)

Change-Id: I30bab7417edb548bdbbe39070562ca9e7b10075a
Signed-off-by: Cecilia Vela Gurovic's avatarCecilia Vela Gurovic <ceciliavg@catalyst.net.nz>
parent 48d13bd1
......@@ -430,11 +430,11 @@ if (!defined('_ADODB_LAYER')) {
var $dataProvider = 'native';
var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql
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.
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 $host = ''; /// The hostname of the database server
var $user = ''; /// The username which is used to connect to the database server.
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
var $substr = 'substr'; /// substring operator
var $length = 'length'; /// string length ofperator
......@@ -654,7 +654,7 @@ if (!defined('_ADODB_LAYER')) {
$this->user = $argUsername;
}
if ($argPassword != "") {
$this->password = 'not stored'; // not stored for security reasons
$this->password = $argPassword;
}
if ($argDatabaseName != "") {
$this->database = $argDatabaseName;
......@@ -3039,6 +3039,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
......@@ -4973,3 +4976,4 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
}
}
?>
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