本文整理汇总了PHP中PMA_SQP_bug函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_SQP_bug函数的具体用法?PHP PMA_SQP_bug怎么用?PHP PMA_SQP_bug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_SQP_bug函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_SQP_parse
//.........这里部分代码省略.........
if ($first == ',' || $first == ';' || $first == '.' || $first == '*') {
$count2 = $count1 + 1;
$punct_data = $first;
} else {
if ($last2 == '/*' || $last2 == '--' && ($count2 == $len || PMA_substr($sql, $count2, 1) <= ' ')) {
$count2 -= 2;
$punct_data = PMA_substr($sql, $count1, $count2 - $count1);
} else {
if ($last == '-' || $last == '+' || $last == '!') {
$count2--;
$punct_data = PMA_substr($sql, $count1, $count2 - $count1);
// TODO: for negation operator, split in 2 tokens ?
// "select x&~1 from t"
// becomes "select x & ~ 1 from t" ?
} else {
if ($last != '~') {
$debugstr = $GLOBALS['strSQPBugUnknownPunctuation'] . ' @ ' . ($count1 + 1) . "\n" . 'STR: ' . htmlspecialchars($punct_data);
PMA_SQP_throwError($debugstr, $sql);
return $sql;
}
}
}
}
PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize);
continue;
}
}
// end if... else if... else
continue;
}
// DEBUG
$count2++;
$debugstr = 'C1 C2 LEN: ' . $count1 . ' ' . $count2 . ' ' . $len . "\n" . 'STR: ' . PMA_substr($sql, $count1, $count2 - $count1) . "\n";
PMA_SQP_bug($debugstr, $sql);
return $sql;
}
// end while ($count2 < $len)
if ($arraysize > 0) {
$t_next = $sql_array[0]['type'];
$t_prev = '';
$t_bef_prev = '';
$t_cur = '';
$d_next = $sql_array[0]['data'];
$d_prev = '';
$d_bef_prev = '';
$d_cur = '';
$d_next_upper = $t_next == 'alpha' ? strtoupper($d_next) : $d_next;
$d_prev_upper = '';
$d_bef_prev_upper = '';
$d_cur_upper = '';
}
for ($i = 0; $i < $arraysize; $i++) {
$t_bef_prev = $t_prev;
$t_prev = $t_cur;
$t_cur = $t_next;
$d_bef_prev = $d_prev;
$d_prev = $d_cur;
$d_cur = $d_next;
$d_bef_prev_upper = $d_prev_upper;
$d_prev_upper = $d_cur_upper;
$d_cur_upper = $d_next_upper;
if ($i + 1 < $arraysize) {
$t_next = $sql_array[$i + 1]['type'];
$d_next = $sql_array[$i + 1]['data'];
$d_next_upper = $t_next == 'alpha' ? strtoupper($d_next) : $d_next;
} else {
示例2: PMA_SQP_parse
//.........这里部分代码省略.........
} else {
// Bad luck, lets split it up more
$first = $punct_data[0];
$last2 = $punct_data[$l - 2] . $punct_data[$l - 1];
$last = $punct_data[$l - 1];
if ($first == ',' || $first == ';' || $first == '.' || $first == '*') {
$count2 = $count1 + 1;
$punct_data = $first;
} elseif ($last2 == '/*' || $last2 == '--' && ($count2 == $len || mb_substr($sql, $count2, 1) <= ' ')) {
$count2 -= 2;
$punct_data = mb_substr($sql, $count1, $count2 - $count1);
} elseif ($last == '-' || $last == '+' || $last == '!') {
$count2--;
$punct_data = mb_substr($sql, $count1, $count2 - $count1);
} elseif ($last != '~') {
/**
* @todo for negation operator, split in 2 tokens ?
* "select x&~1 from t"
* becomes "select x & ~ 1 from t" ?
*/
$debugstr = __('Unknown Punctuation String') . ' @ ' . ($count1 + 1) . "\n" . 'STR: ' . htmlspecialchars($punct_data);
PMA_SQP_throwError($debugstr, $sql);
return $sql_array;
}
PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize, $count2);
continue;
}
// end if... elseif... else
continue;
}
// DEBUG
$count2++;
$debugstr = 'C1 C2 LEN: ' . $count1 . ' ' . $count2 . ' ' . $len . "\n" . 'STR: ' . mb_substr($sql, $count1, $count2 - $count1) . "\n";
PMA_SQP_bug($debugstr, $sql);
return $sql_array;
}
// end while ($count2 < $len)
/*
echo '<pre>';
print_r($sql_array);
echo '</pre>';
*/
if ($arraysize > 0) {
$t_next = $sql_array[0]['type'];
$t_prev = '';
$t_cur = '';
$d_next = $sql_array[0]['data'];
$d_prev = '';
$d_cur = '';
$d_next_upper = $t_next == 'alpha' ? mb_strtoupper($d_next) : $d_next;
$d_prev_upper = '';
$d_cur_upper = '';
}
for ($i = 0; $i < $arraysize; $i++) {
$t_prev = $t_cur;
$t_cur = $t_next;
$d_prev = $d_cur;
$d_cur = $d_next;
$d_bef_prev_upper = $d_prev_upper;
$d_prev_upper = $d_cur_upper;
$d_cur_upper = $d_next_upper;
if ($i + 1 < $arraysize) {
$t_next = $sql_array[$i + 1]['type'];
$d_next = $sql_array[$i + 1]['data'];
$d_next_upper = $t_next == 'alpha' ? mb_strtoupper($d_next) : $d_next;
} else {