Beispiel #1
0
 /**
  * @param string $table
  * @param array $columns
  * @param CPerfQuery $q
  * @return boolean
  */
 public static function GatherExpressStat($table, $columns, $q)
 {
     $arColumns = explode(",", $columns);
     if (count($arColumns) != 1) {
         return false;
     }
     $column = trim($arColumns[0], "`");
     $value = trim($q->find_value($table, $arColumns[0]), "'");
     if ($value == "") {
         return false;
     }
     $tab = new CPerfomanceTable();
     $tab->Init($table);
     if ($tab->IsExists()) {
         $arTableColumns = CPerfQueryStat::GetTableColumns($table);
         if (!array_key_exists($column, $arTableColumns)) {
             return false;
         }
         //May be it is worth to ban
         if ($arTableColumns[$column]["Type"] === "char(1)") {
             if (is_array(CPerfQueryStat::_get_stat($table, $arColumns[0]))) {
                 return true;
             }
             if (CPerfQueryStat::_gather_stat($table, $arColumns[0], $value, 10 * 1024 * 1024)) {
                 return true;
             }
         }
         return false;
     } else {
         return false;
     }
 }
	</tr>
	<tr>
		<td align="right" class="adm-detail-valign-top">
			<table class="internal">
			<tr class="heading">
				<td><?php 
echo GetMessage("PERFMON_IDETAIL_TABLE_COLUMN");
?>
</td>
				<td><?php 
echo GetMessage("PERFMON_IDETAIL_COLUMN_DATA_TYPE");
?>
</td>
			</tr>
			<?php 
foreach (CPerfQueryStat::GetTableColumns($arSuggest["TABLE_NAME"]) as $column_name => $arColumn) {
    $b = in_array($column_name, $arColumns);
    ?>
			<tr>
				<td><?php 
    echo ($b ? "<b>" : "") . htmlspecialcharsex($column_name) . ($b ? "</b>" : "");
    ?>
</td>
				<td><?php 
    echo htmlspecialcharsex($arColumn["Type"]);
    ?>
</td>
			</tr>
			<?php 
}
?>