当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_STR_binarySearchInArr函数代码示例

本文整理汇总了PHP中PMA_STR_binarySearchInArr函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_STR_binarySearchInArr函数的具体用法?PHP PMA_STR_binarySearchInArr怎么用?PHP PMA_STR_binarySearchInArr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_STR_binarySearchInArr函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_backquote

/**
 * Adds backquotes on both sides of a database, table or field name.
 * and escapes backquotes inside the name with another backquote
 *
 * example:
 * <code>
 * echo PMA_backquote('owner`s db'); // `owner``s db`
 *
 * </code>
 *
 * @uses    PMA_backquote()
 * @uses    is_array()
 * @uses    strlen()
 * @uses    str_replace()
 * @param   mixed    $a_name    the database, table or field name to "backquote"
 *                              or array of it
 * @param   boolean  $do_it     a flag to bypass this function (used by dump
 *                              functions)
 * @return  mixed    the "backquoted" database, table or field name if the
 *                   current MySQL release is >= 3.23.6, the original one
 *                   else
 * @access  public
 */
function PMA_backquote($a_name, $do_it = true)
{
    if (is_array($a_name)) {
        foreach ($a_name as &$data) {
            $data = PMA_backquote($data, $do_it);
        }
        return $a_name;
    }
    if (!$do_it) {
        global $PMA_SQPdata_forbidden_word;
        global $PMA_SQPdata_forbidden_word_cnt;
        if (!PMA_STR_binarySearchInArr(strtoupper($a_name), $PMA_SQPdata_forbidden_word, $PMA_SQPdata_forbidden_word_cnt)) {
            return $a_name;
        }
    }
    // '0' is also empty for php :-(
    if (strlen($a_name) && $a_name !== '*') {
        return '`' . str_replace('`', '``', $a_name) . '`';
    } else {
        return $a_name;
    }
}
开发者ID:davidmottet,项目名称:automne,代码行数:45,代码来源:common.lib.php

示例2: PMA_SQP_formatHtml


//.........这里部分代码省略.........
         $typearr[3] = $arr[$start_token]['type'];
     }
     $in_priv_list = FALSE;
     for ($i = $start_token; $i < $arraysize; $i++) {
         // DEBUG echo "<b>" . $arr[$i]['data'] . "</b> " . $arr[$i]['type'] . "<br />";
         $before = '';
         $after = '';
         $indent = 0;
         // array_shift($typearr);
         /*
         0 prev2
         1 prev
         2 current
         3 next
         */
         if ($i + 1 < $arraysize) {
             // array_push($typearr, $arr[$i + 1]['type']);
             $typearr[4] = $arr[$i + 1]['type'];
         } else {
             //array_push($typearr, NULL);
             $typearr[4] = '';
         }
         for ($j = 0; $j < 4; $j++) {
             $typearr[$j] = $typearr[$j + 1];
         }
         switch ($typearr[2]) {
             case 'white_newline':
                 $before = '';
                 break;
             case 'punct_bracket_open_round':
                 $bracketlevel++;
                 $infunction = FALSE;
                 // Make sure this array is sorted!
                 if ($typearr[1] == 'alpha_functionName' || $typearr[1] == 'alpha_columnType' || $typearr[1] == 'punct' || $typearr[3] == 'digit_integer' || $typearr[3] == 'digit_hex' || $typearr[3] == 'digit_float' || $typearr[0] == 'alpha_reservedWord' && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 2]['data']), $keywords_with_brackets_2before, $keywords_with_brackets_2before_cnt) || $typearr[1] == 'alpha_reservedWord' && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 1]['data']), $keywords_with_brackets_1before, $keywords_with_brackets_1before_cnt)) {
                     $functionlevel++;
                     $infunction = TRUE;
                     $after .= ' ';
                 } else {
                     $indent++;
                     $after .= $mode != 'query_only' ? '<div class="syntax_indent' . $indent . '">' : ' ';
                 }
                 break;
             case 'alpha_identifier':
                 if ($typearr[1] == 'punct_qualifier' || $typearr[3] == 'punct_qualifier') {
                     $after = '';
                     $before = '';
                 }
                 if ($typearr[3] == 'alpha_columnType' || $typearr[3] == 'alpha_identifier') {
                     $after .= ' ';
                 }
                 break;
             case 'punct_qualifier':
                 $before = '';
                 $after = '';
                 break;
             case 'punct_listsep':
                 if ($infunction == TRUE) {
                     $after .= $space_punct_listsep_function_name;
                 } else {
                     $after .= $space_punct_listsep;
                 }
                 break;
             case 'punct_queryend':
                 if ($typearr[3] != 'comment_mysql' && $typearr[3] != 'comment_ansi' && $typearr[3] != 'comment_c') {
                     $after .= $html_line_break;
                     $after .= $html_line_break;
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:67,代码来源:sqlparser.lib.php

示例3: PMA_SQP_formatHtml


//.........这里部分代码省略.........
     for ($i = $start_token; $i < $arraysize; $i++) {
         // DEBUG echo "Loop format <strong>" . $arr[$i]['data'] . "</strong> " . $arr[$i]['type'] . "<br />";
         $before = '';
         $after = '';
         // array_shift($typearr);
         /*
         0 prev2
         1 prev
         2 current
         3 next
         */
         if ($i + 1 < $arraysize) {
             // array_push($typearr, $arr[$i + 1]['type']);
             $typearr[4] = $arr[$i + 1]['type'];
         } else {
             //array_push($typearr, null);
             $typearr[4] = '';
         }
         for ($j = 0; $j < 4; $j++) {
             $typearr[$j] = $typearr[$j + 1];
         }
         switch ($typearr[2]) {
             case 'alpha_bitfield_constant_introducer':
                 $before = ' ';
                 $after = '';
                 break;
             case 'white_newline':
                 $before = '';
                 break;
             case 'punct_bracket_open_round':
                 $bracketlevel++;
                 $infunction = FALSE;
                 // Make sure this array is sorted!
                 if ($typearr[1] == 'alpha_functionName' || $typearr[1] == 'alpha_columnType' || $typearr[1] == 'punct' || $typearr[3] == 'digit_integer' || $typearr[3] == 'digit_hex' || $typearr[3] == 'digit_float' || $typearr[0] == 'alpha_reservedWord' && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 2]['data']), $keywords_with_brackets_2before, $keywords_with_brackets_2before_cnt) || $typearr[1] == 'alpha_reservedWord' && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 1]['data']), $keywords_with_brackets_1before, $keywords_with_brackets_1before_cnt)) {
                     $functionlevel++;
                     $infunction = TRUE;
                     $after .= ' ';
                 } else {
                     $indent++;
                     $after .= $mode != 'query_only' ? '<div class="syntax_indent' . $indent . '">' : ' ';
                 }
                 break;
             case 'alpha_identifier':
                 if ($typearr[1] == 'punct_qualifier' || $typearr[3] == 'punct_qualifier') {
                     $after = '';
                     $before = '';
                 }
                 // for example SELECT 1 somealias
                 if ($typearr[1] == 'digit_integer') {
                     $before = ' ';
                 }
                 if ($typearr[3] == 'alpha_columnType' || $typearr[3] == 'alpha_identifier') {
                     $after .= ' ';
                 }
                 break;
             case 'punct_user':
             case 'punct_qualifier':
                 $before = '';
                 $after = '';
                 break;
             case 'punct_listsep':
                 if ($infunction == TRUE) {
                     $after .= $space_punct_listsep_function_name;
                 } else {
                     $after .= $space_punct_listsep;
                 }
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:67,代码来源:sqlparser.lib.php


注:本文中的PMA_STR_binarySearchInArr函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。