Vergleich inc/db_mysql.php - 1.8.25 - 1.8.33

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 72Zeile 72
	 * @var resource
*/
public $current_link;

	 * @var resource
*/
public $current_link;

 

/**
* @var array
*/
public $connections = array();


/**
* The database name.


/**
* The database name.

Zeile 175Zeile 180
			else
{
$connections = $config;

			else
{
$connections = $config;

			}
}

			}
}


$this->db_encoding = $config['encoding'];



$this->db_encoding = $config['encoding'];


Zeile 186Zeile 191
			if(!isset($connections[$type]) || !is_array($connections[$type]))
{
break;

			if(!isset($connections[$type]) || !is_array($connections[$type]))
{
break;

			}


			}


			if(array_key_exists('hostname', $connections[$type]))
{
$details = $connections[$type];
unset($connections[$type]);
$connections[$type][] = $details;

			if(array_key_exists('hostname', $connections[$type]))
{
$details = $connections[$type];
unset($connections[$type]);
$connections[$type][] = $details;

			}

			}


// Shuffle the connections
shuffle($connections[$type]);


// Shuffle the connections
shuffle($connections[$type]);

Zeile 205Zeile 210
				if(isset($single_connection['pconnect']))
{
$connect_function = "mysql_pconnect";

				if(isset($single_connection['pconnect']))
{
$connect_function = "mysql_pconnect";

				}


				}


				$link = "{$type}_link";

				$link = "{$type}_link";





				get_execution_time();

$this->$link = @$connect_function($single_connection['hostname'], $single_connection['username'], $single_connection['password'], 1);

				get_execution_time();

$this->$link = @$connect_function($single_connection['hostname'], $single_connection['username'], $single_connection['password'], 1);





				$time_spent = get_execution_time();
$this->query_time += $time_spent;

// Successful connection? break down brother!
if($this->$link)

				$time_spent = get_execution_time();
$this->query_time += $time_spent;

// Successful connection? break down brother!
if($this->$link)

				{

				{

					$this->connections[] = "[".strtoupper($type)."] {$single_connection['username']}@{$single_connection['hostname']} (Connected in ".format_time_duration($time_spent).")";
break;

					$this->connections[] = "[".strtoupper($type)."] {$single_connection['username']}@{$single_connection['hostname']} (Connected in ".format_time_duration($time_spent).")";
break;

				}

				}

				else
{
$this->connections[] = "<span style=\"color: red\">[FAILED] [".strtoupper($type)."] {$single_connection['username']}@{$single_connection['hostname']}</span>";

				else
{
$this->connections[] = "<span style=\"color: red\">[FAILED] [".strtoupper($type)."] {$single_connection['username']}@{$single_connection['hostname']}</span>";

				}
}
}


				}
}
}


		// No write server was specified (simple connection or just multiple servers) - mirror write link
if(!array_key_exists('write', $connections))
{

		// No write server was specified (simple connection or just multiple servers) - mirror write link
if(!array_key_exists('write', $connections))
{

Zeile 252Zeile 257
		if(!$this->select_db($config['database']))
{
return -1;

		if(!$this->select_db($config['database']))
{
return -1;

		}

$this->current_link = &$this->read_link;

		}

$this->current_link = &$this->read_link;

		return $this->read_link;
}


		return $this->read_link;
}


Zeile 279Zeile 284
		else
{
$success = $read_success;

		else
{
$success = $read_success;

		}

		}


if($success && $this->db_encoding)
{
// A little magic to support PHP 5.2.0, 5.2.1 and 5.2.2
if(version_compare(PHP_VERSION, '5.2.3', '>=')) {
@mysql_set_charset($this->db_encoding, $this->read_link);


if($success && $this->db_encoding)
{
// A little magic to support PHP 5.2.0, 5.2.1 and 5.2.2
if(version_compare(PHP_VERSION, '5.2.3', '>=')) {
@mysql_set_charset($this->db_encoding, $this->read_link);

			}

			}

			else
{
$this->query("SET NAMES '{$this->db_encoding}'");

			else
{
$this->query("SET NAMES '{$this->db_encoding}'");

Zeile 305Zeile 310
		}
return $success;
}

		}
return $success;
}





	/**
* Query the database.
*

	/**
* Query the database.
*

Zeile 330Zeile 335
		{
$this->current_link = &$this->read_link;
$query = @mysql_query($string, $this->read_link);

		{
$this->current_link = &$this->read_link;
$query = @mysql_query($string, $this->read_link);

		}

		}


if($this->error_number() && !$hide_errors)
{


if($this->error_number() && !$hide_errors)
{

Zeile 433Zeile 438
			$this->explain .= "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n".
"<tr>\n".
"<td style=\"background-color: #ccc;\">{$debug_extra}<div><strong>#".$this->query_count." - Write Query</strong></div></td>\n".

			$this->explain .= "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n".
"<tr>\n".
"<td style=\"background-color: #ccc;\">{$debug_extra}<div><strong>#".$this->query_count." - Write Query</strong></div></td>\n".

				"</tr>\n".

				"</tr>\n".

				"<tr style=\"background-color: #fefefe;\">\n".
"<td><span style=\"font-family: Courier; font-size: 14px;\">".htmlspecialchars_uni($string)."</span></td>\n".
"</tr>\n".

				"<tr style=\"background-color: #fefefe;\">\n".
"<td><span style=\"font-family: Courier; font-size: 14px;\">".htmlspecialchars_uni($string)."</span></td>\n".
"</tr>\n".

Zeile 446Zeile 451

$this->querylist[$this->query_count]['query'] = $string;
$this->querylist[$this->query_count]['time'] = $qtime;


$this->querylist[$this->query_count]['query'] = $string;
$this->querylist[$this->query_count]['time'] = $qtime;

	}

	}


/**
* Return a result array for a query.


/**
* Return a result array for a query.

Zeile 485Zeile 490
		if($row === false)
{
$array = $this->fetch_array($query);

		if($row === false)
{
$array = $this->fetch_array($query);

			return $array[$field];





			if($array !== null)
{
return $array[$field];
}
return null;

		}
else
{

		}
else
{

Zeile 1412Zeile 1421
			$default = '';
}


			$default = '';
}


		return (bool)$this->write_query("ALTER TABLE {$this->table_prefix}{$table} MODIFY `{$column}` {$new_definition} {$not_null}");

		return (bool)$this->write_query("ALTER TABLE {$this->table_prefix}{$table} MODIFY `{$column}` {$new_definition} {$not_null} {$default}");

	}

/**

	}

/**