Commit 86738f46 authored by Penny Leach's avatar Penny Leach Committed by Gerrit Code Review

ADODB modification: add __wakeup to connection object

Bug 1384473

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: I00f38a6cf101019fb684b4f5c9b40c2d937b614d
Signed-off-by: 's avatarPenny Leach <penny@mjollnir.org>
Signed-off-by: 's avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 2fab3387
......@@ -2,11 +2,10 @@ adodb
-----
Source: http://adodb.sourceforge.net/
Version: 5.18
Version: 5.19
Modifications:
- fix MySQL bug on installing Mahara (e7029e5fc1fd3329a3a817f26b2ad5c3f61239cf)
- 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)
......
......@@ -367,7 +367,7 @@ if (!defined('_ADODB_LAYER')) {
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
......@@ -539,7 +539,7 @@ if (!defined('_ADODB_LAYER')) {
{
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;
......@@ -2764,6 +2764,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