1
0
Fork 0

SQL-Server / Show variables:

- added column which outputs numeric values in human readable form (e.g. xx MB)

MySQLi:
- added option max_allowed_packet = 64MB at each connection for handling big blob fields (should be moved to general options array later on)
Dieser Commit ist enthalten in:
DSB 2012-07-28 20:27:25 +00:00
Ursprung a87490e72f
Commit bfc06577ff
3 geänderte Dateien mit 30 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -19,19 +19,33 @@
<th class="right">#</th>
<th><strong><?php echo $this->lang->L_NAME;?></strong></th>
<th><strong><?php echo $this->lang->L_VALUE;?></strong></th>
<th class="nowrap"><?php echo $this->lang->L_INTERPRETED_AS_BYTES;?></th>
</tr>
<?php
$i = 1;
$cycleHelper = $this->getHelper('cycle')->cycle(array('row-even', 'row-odd'));
foreach ($this->variables as $name => $value) : ?>
foreach ($this->variables as $name => $value) {
if (strpos($value, ',') !== false) {
$value = str_replace(',', ', ', $value);
}
?>
<tr class="<?php echo $cycleHelper->next()?>">
<td class="small right"><?php echo $i;?>.</td>
<td class="small"><?php echo $this->escape($name);?></td>
<td class="small"><?php echo $this->escape($value);?></td>
</tr>
<?php
++$i;
endforeach;
<td class="small nowrap">
<?php
if (is_numeric($value)) {
echo $this->byteOutput($value);
} else {
echo '-';
}
?>
</td>
</tr><?php
++$i;
};
?>
</table>
<br /><br /><br />

Datei anzeigen

@ -38,7 +38,7 @@ class Msd_Db_Mysql extends Msd_Db_MysqlCommon
* $this->_connectionHandle.
* Returns true on success or false if connection couldn't be established.
*
* @throws Exception
* @throws Msd_Exception
* @return bool
**/
protected function _dbConnect()
@ -124,7 +124,7 @@ class Msd_Db_Mysql extends Msd_Db_MysqlCommon
*
* Returns true if selection was succesfull otherwise false.
*
* @throws Exception
* @throws Msd_Exception
* @param string $database The database to select
*
* @return bool

Datei anzeigen

@ -31,6 +31,8 @@ class Msd_Db_Mysqli extends Msd_Db_MysqlCommon
* Create a connection to MySQL and store the connection handle in
* $this->connectionHandle.
*
* @throws Msd_Exception
*
* @return boolean
**/
protected function _dbConnect()
@ -49,6 +51,8 @@ class Msd_Db_Mysqli extends Msd_Db_MysqlCommon
$this->_socket
);
error_reporting($errorReporting);
$this->_mysqli->init();
$this->_mysqli->options(MYSQLI_READ_DEFAULT_GROUP, 'max_allowed_packet=64M');
if ($this->_mysqli->connect_errno) {
$error = $this->_mysqli->connect_error;
$errno = $this->_mysqli->connect_errno;
@ -141,8 +145,8 @@ class Msd_Db_Mysqli extends Msd_Db_MysqlCommon
* is returned.
*
* @param string $query The query to execute
* @param const $kind Type of result set
* @param boolean $getRows Wether to fetch all rows and return them
* @param int $kind Type of result set
* @param boolean $getRows Whether to fetch all rows and return them
*
* @return resource|array
*/
@ -183,7 +187,7 @@ class Msd_Db_Mysqli extends Msd_Db_MysqlCommon
*
* Can be used to walk through result sets.
*
* @param const $kind
* @param int $kind
*
* @return array|object
*/
@ -197,6 +201,7 @@ class Msd_Db_Mysqli extends Msd_Db_MysqlCommon
return $this->_resultHandle->fetch_object();
break;
case self::ARRAY_NUMERIC:
default:
return $this->_resultHandle->fetch_array(MYSQLI_NUM);
break;
}