Vergleich inc/db_mysqli.php - 1.6.3 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: db_mysqli.php 5380 2011-02-21 12:04:43Z Tomm $

 * $Id$

 */

class DB_MySQLi

 */

class DB_MySQLi

Zeile 166Zeile 166
		// Actually connect to the specified servers
foreach(array('read', 'write') as $type)
{

		// Actually connect to the specified servers
foreach(array('read', 'write') as $type)
{

			if(!is_array($connections[$type]))

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

			{
break;
}

			{
break;
}

Zeile 184Zeile 184
			// Loop-de-loop
foreach($connections[$type] as $single_connection)
{

			// Loop-de-loop
foreach($connections[$type] as $single_connection)
{

				$connect_function = "mysqli_connect";
$persist = "";
if($single_connection['pconnect'] && version_compare(PHP_VERSION, '5.3.0', '>='))

				$persist = '';
$connect_function = 'mysqli_connect';
if(isset($single_connection['pconnect']) && version_compare(PHP_VERSION, '5.3.0', '>='))

				{

				{

					$persist = "p:";

					$persist = 'p:';

				}

				}

				
$link = $type."_link";


$link = "{$type}_link";


$this->get_execution_time();


$this->get_execution_time();





				// Specified a custom port for this connection?

				// Specified a custom port for this connection?

				list($hostname, $port) = explode(":", $single_connection['hostname'], 2);






				$port = 0;
if(strstr($single_connection['hostname'],':'))
{
list($hostname, $port) = explode(":", $single_connection['hostname'], 2);
}


				if($port)
{
$this->$link = @$connect_function($persist.$hostname, $single_connection['username'], $single_connection['password'], "", $port);

				if($port)
{
$this->$link = @$connect_function($persist.$hostname, $single_connection['username'], $single_connection['password'], "", $port);

Zeile 232Zeile 237
		if(!$this->read_link)
{
$this->error("[READ] Unable to connect to MySQL server");

		if(!$this->read_link)
{
$this->error("[READ] Unable to connect to MySQL server");

			return false;

			return false;

		}
// No write?
else if(!$this->write_link)

		}
// No write?
else if(!$this->write_link)

Zeile 271Zeile 276
		else
{
$success = $master_success;

		else
{
$success = $master_success;

		}

		}

		
if($success && $this->db_encoding)
{

		
if($success && $this->db_encoding)
{

Zeile 309Zeile 314
		{
$this->current_link = &$this->read_link;
$query = @mysqli_query($this->read_link, $string);

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

		}


		}


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

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

Zeile 349Zeile 354
	function explain_query($string, $qtime)
{
global $plugins;

	function explain_query($string, $qtime)
{
global $plugins;

 

$debug_extra = '';

		if($plugins->current_hook)
{
$debug_extra = "<div style=\"float_right\">(Plugin Hook: {$plugins->current_hook})</div>";

		if($plugins->current_hook)
{
$debug_extra = "<div style=\"float_right\">(Plugin Hook: {$plugins->current_hook})</div>";

Zeile 361Zeile 368
				"<td colspan=\"8\" style=\"background-color: #ccc;\">{$debug_extra}<div><strong>#".$this->query_count." - Select Query</strong></div></td>\n".
"</tr>\n".
"<tr>\n".

				"<td colspan=\"8\" style=\"background-color: #ccc;\">{$debug_extra}<div><strong>#".$this->query_count." - Select Query</strong></div></td>\n".
"</tr>\n".
"<tr>\n".

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

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

				"</tr>\n".
"<tr style=\"background-color: #efefef;\">\n".
"<td><strong>table</strong></td>\n".

				"</tr>\n".
"<tr style=\"background-color: #efefef;\">\n".
"<td><strong>table</strong></td>\n".