1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00

MDL-14992 sessions - proper destructor method and fixed dispose() behaviour.

This commit is contained in:
stronk7 2009-05-26 14:46:01 +00:00
parent bc76b3c02f
commit 8fdb24f079
5 changed files with 5 additions and 5 deletions

@ -98,10 +98,10 @@ abstract class adodb_moodle_database extends moodle_database {
* Do NOT use connect() again, create a new instance if needed.
*/
public function dispose() {
parent::dispose(); // Call parent dispose to write/close session and other common stuff before clossing conn
if ($this->adodb) {
$this->adodb->Close();
}
parent::dispose();
}
/**

@ -94,7 +94,7 @@ abstract class moodle_database {
/**
* Destructor - cleans up and flushes everything needed.
*/
public function __desctruct() {
public function __destruct() {
$this->dispose();
}

@ -159,11 +159,11 @@ class mysqli_native_moodle_database extends moodle_database {
* Do NOT use connect() again, create a new instance if needed.
*/
public function dispose() {
parent::dispose(); // Call parent dispose to write/close session and other common stuff before clossing conn
if ($this->mysqli) {
$this->mysqli->close();
$this->mysqli = null;
}
parent::dispose();
}
/**

@ -154,11 +154,11 @@ class oci_native_moodle_database extends moodle_database {
* Do NOT use connect() again, create a new instance if needed.
*/
public function dispose() {
parent::dispose(); // Call parent dispose to write/close session and other common stuff before clossing conn
if ($this->oci) {
oci_close($this->oci);
$this->oci = null;
}
parent::dispose();
}

@ -166,11 +166,11 @@ class pgsql_native_moodle_database extends moodle_database {
* Do NOT use connect() again, create a new instance if needed.
*/
public function dispose() {
parent::dispose(); // Call parent dispose to write/close session and other common stuff before clossing conn
if ($this->pgsql) {
pg_close($this->pgsql);
$this->pgsql = null;
}
parent::dispose();
}