mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Fiddle with object destruction and shutdown. Curses upon php 5.2. fixes #3354
git-svn-id: https://develop.svn.wordpress.org/trunk@4686 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -44,6 +44,12 @@ class wpdb {
|
||||
* @param string $dbhost
|
||||
*/
|
||||
function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
|
||||
return $this->__construct($dbuser, $dbpassword, $dbname, $dbhost);
|
||||
}
|
||||
|
||||
function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
|
||||
register_shutdown_function(array(&$this, "__destruct"));
|
||||
|
||||
$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
|
||||
if (!$this->dbh) {
|
||||
$this->bail("
|
||||
@@ -61,6 +67,10 @@ class wpdb {
|
||||
$this->select($dbname);
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects a database using the current class's $this->dbh
|
||||
* @param string $db name
|
||||
|
||||
Reference in New Issue
Block a user