本文整理汇总了PHP中PMA_SQP_formatHTML_colorize函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_SQP_formatHTML_colorize函数的具体用法?PHP PMA_SQP_formatHTML_colorize怎么用?PHP PMA_SQP_formatHTML_colorize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_SQP_formatHTML_colorize函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_SQP_formatHtml
//.........这里部分代码省略.........
}
break;
case 'EXPLAIN':
case 'DESCRIBE':
case 'SET':
case 'ALTER':
case 'DELETE':
case 'SHOW':
case 'DROP':
case 'UPDATE':
case 'TRUNCATE':
case 'ANALYZE':
case 'ANALYSE':
if (!$in_priv_list) {
$space_punct_listsep = $html_line_break;
$space_alpha_reserved_word = ' ';
}
break;
case 'INSERT':
case 'REPLACE':
if (!$in_priv_list) {
$space_punct_listsep = $html_line_break;
$space_alpha_reserved_word = $html_line_break;
}
break;
case 'VALUES':
$space_punct_listsep = ' ';
$space_alpha_reserved_word = $html_line_break;
break;
case 'SELECT':
$space_punct_listsep = ' ';
$space_alpha_reserved_word = $html_line_break;
break;
default:
break;
}
// end switch ($arr[$i]['data'])
$after .= ' ';
break;
case 'digit_integer':
case 'digit_float':
case 'digit_hex':
//TODO: could there be other types preceding a digit?
if ($typearr[1] == 'alpha_reservedWord') {
$after .= ' ';
}
if ($infunction && $typearr[3] == 'punct_bracket_close_round') {
$after .= ' ';
}
if ($typearr[1] == 'alpha_columnAttrib') {
$before .= ' ';
}
break;
case 'alpha_variable':
// other workaround for a problem similar to the one
// explained below for quote_single
if (!$in_priv_list) {
$after = ' ';
}
break;
case 'quote_double':
case 'quote_single':
// workaround: for the query
// REVOKE SELECT ON `base2\_db`.* FROM 'user'@'%'
// the @ is incorrectly marked as alpha_variable
// in the parser, and here, the '%' gets a blank before,
// which is a syntax error
if ($typearr[1] != 'alpha_variable') {
$before .= ' ';
}
if ($infunction && $typearr[3] == 'punct_bracket_close_round') {
$after .= ' ';
}
break;
case 'quote_backtick':
if ($typearr[3] != 'punct_qualifier') {
$after .= ' ';
}
if ($typearr[1] != 'punct_qualifier') {
$before .= ' ';
}
break;
default:
break;
}
// end switch ($typearr[2])
/*
if ($typearr[3] != 'punct_qualifier') {
$after .= ' ';
}
$after .= "\n";
*/
$str .= $before . ($mode == 'color' ? PMA_SQP_formatHTML_colorize($arr[$i]) : $arr[$i]['data']) . $after;
}
// end for
if ($mode == 'color') {
$str .= '</span>';
}
return $str;
}
示例2: PMA_SQP_formatHtml
//.........这里部分代码省略.........
$tempname = strtoupper($arr[$i]['data'] . '_' . $arr[$i + 1]['data']);
$before .= PMA_Util::showMySQLDocu('functions', $PMA_SQPdata_functions_docs[$tempname]['link'], false, $PMA_SQPdata_functions_docs[$tempname]['anchor'], true);
$close_docu_link = true;
} else {
$before .= PMA_Util::showMySQLDocu('functions', $PMA_SQPdata_functions_docs[$arr[$i]['data']]['link'], false, $PMA_SQPdata_functions_docs[$arr[$i]['data']]['anchor'], true);
$after .= '</a>';
}
}
}
}
break;
}
// end switch ($arr[$i]['data'])
$after .= ' ';
break;
case 'digit_integer':
case 'digit_float':
case 'digit_hex':
/**
* @todo could there be other types preceding a digit?
*/
if ($typearr[1] == 'alpha_reservedWord') {
$after .= ' ';
}
if ($infunction && $typearr[3] == 'punct_bracket_close_round') {
$after .= ' ';
}
if ($typearr[1] == 'alpha_columnAttrib') {
$before .= ' ';
}
break;
case 'alpha_variable':
$after = ' ';
break;
case 'quote_double':
case 'quote_single':
// workaround: for the query
// REVOKE SELECT ON `base2\_db`.* FROM 'user'@'%'
// the @ is incorrectly marked as alpha_variable
// in the parser, and here, the '%' gets a blank before,
// which is a syntax error
if ($typearr[1] != 'punct_user' && $typearr[1] != 'alpha_bitfield_constant_introducer') {
$before .= ' ';
}
if ($infunction && $typearr[3] == 'punct_bracket_close_round') {
$after .= ' ';
}
break;
case 'quote_backtick':
// here we check for punct_user to handle correctly
// DEFINER = `username`@`%`
// where @ is the punct_user and `%` is the quote_backtick
if ($typearr[3] != 'punct_qualifier' && $typearr[3] != 'alpha_variable' && $typearr[3] != 'punct_user') {
$after .= ' ';
}
if ($typearr[1] != 'punct_qualifier' && $typearr[1] != 'alpha_variable' && $typearr[1] != 'punct_user') {
$before .= ' ';
}
break;
default:
break;
}
// end switch ($typearr[2])
/*
if ($typearr[3] != 'punct_qualifier') {
$after .= ' ';
}
$after .= "\n";
*/
$str .= $before;
if ($mode == 'color') {
$str .= PMA_SQP_formatHTML_colorize($arr[$i]);
} elseif ($mode == 'text') {
$str .= htmlspecialchars($arr[$i]['data']);
} else {
$str .= $arr[$i]['data'];
}
$str .= $after;
}
// end for
// close unclosed indent levels
while ($indent > 0) {
$indent--;
$str .= $mode != 'query_only' ? '</div>' : ' ';
}
/* End possibly unclosed documentation link */
if ($close_docu_link) {
$str .= '</a>';
$close_docu_link = false;
}
if ($mode != 'query_only') {
// close inner_sql span
$str .= '</span>';
}
if ($mode == 'color') {
// close syntax span
$str .= '</span>';
}
return $str;
}