Commit c7ec603c authored by Penny Leach's avatar Penny Leach Committed by Robert Lyon

ADODB modification: add __wakeup to connection object

Bug 1539346

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 commit 41707745)

Change-Id: I1a007d0f56dc0e210c3f09e8445c0e56215b9545
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent f4ab7790
......@@ -9,5 +9,6 @@ Modifications:
- RecordSet_postgres7->MoveNext() - remove expensive is_array() (04ef8a3b9770f93326a2ece31e4089368117faca)
- check for Postgres 8.1 (c6dfccadfae432147fff99fa15b0985dcae7e503)
- Check for valid columns in adodb postgres64 driver MetaIndexes fn (b87d9961020a8d52a2eaf709a9197520b3c6b65b)
- add __wakeup to connection object (417077459037550239fe9b09bd20b50d4c19b57f)
- Deleted many files we're not using, including tests, docs, other drivers, other error langs
......@@ -415,11 +415,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
......@@ -639,7 +639,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;
......@@ -3024,6 +3024,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
......
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