diff --git a/Documentation.html b/Documentation.html
index 6f66b64828..4db4ec086a 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -1329,7 +1329,7 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE
login credentials. This is alternative approach to session based single
signon. The script needs to provide function
get_login_credentials which returns list of username and
- pasword, accepting single parameter of existing username (can be empty).
+ password, accepting single parameter of existing username (can be empty).
See scripts/signon-script.php for an example.
$cfg['Servers'][$i]['SignonSession'] string
@@ -3533,7 +3533,7 @@ have either the APC extension
- There is no reliable way to differetiate tables in CSV format. For the time being, you will have to break apart CSV files containing multiple tables.
+ There is no reliable way to differentiate tables in CSV format. For the time being, you will have to break apart CSV files containing multiple tables.
diff --git a/browse_foreigners.php b/browse_foreigners.php
index 0b104841fe..c31d74ca8a 100644
--- a/browse_foreigners.php
+++ b/browse_foreigners.php
@@ -81,7 +81,7 @@ if (is_array($foreignData['disp_row'])) {
phpMyAdmin
-
+
|';
- $allpunct_list_pair = array (
- 0 => '!=',
- 1 => '&&',
- 2 => ':=',
- 3 => '<<',
- 4 => '<=',
- 5 => '<=>',
- 6 => '<>',
- 7 => '>=',
- 8 => '>>',
- 9 => '||',
- 10 => '==',
+ $allpunct_list_pair = array(
+ '!=' => 1,
+ '&&' => 1,
+ ':=' => 1,
+ '<<' => 1,
+ '<=' => 1,
+ '<=>' => 1,
+ '<>' => 1,
+ '>=' => 1,
+ '>>' => 1,
+ '||' => 1,
+ '==' => 1
);
- $allpunct_list_pair_size = 11; //count($allpunct_list_pair);
$quote_list = '\'"`';
$arraysize = 0;
@@ -608,7 +607,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
break;
}
PMA_SQP_arrayAdd($sql_array, 'punct' . $t_suffix, $punct_data, $arraysize);
- } elseif ($punct_data == $GLOBALS['sql_delimiter'] || PMA_STR_binarySearchInArr($punct_data, $allpunct_list_pair, $allpunct_list_pair_size)) {
+ } elseif ($punct_data == $GLOBALS['sql_delimiter'] || isset($allpunct_list_pair[$punct_data])) {
// Ok, we have one of the valid combined punct expressions
PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize);
} else {
@@ -705,7 +704,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
} elseif (($t_next == 'punct_qualifier') || ($t_prev == 'punct_qualifier')) {
$t_suffix = '_identifier';
} elseif (($t_next == 'punct_bracket_open_round')
- && PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_function_name, $PMA_SQPdata_function_name_cnt)) {
+ && isset($PMA_SQPdata_function_name[$d_cur_upper])) {
/**
* @todo 2005-10-16: in the case of a CREATE TABLE containing
* a TIMESTAMP, since TIMESTAMP() is also a function, it's
@@ -717,7 +716,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
*/
$t_suffix = '_functionName';
/* There are functions which might be as well column types */
- } elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_type, $PMA_SQPdata_column_type_cnt)) {
+ } elseif (isset($PMA_SQPdata_column_type[$d_cur_upper])) {
$t_suffix = '_columnType';
/**
@@ -745,9 +744,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// $sql_array[$i-1]['type'] = 'alpha_identifier';
//}
- } elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_reserved_word, $PMA_SQPdata_reserved_word_cnt)) {
+ } elseif (isset($PMA_SQPdata_reserved_word[$d_cur_upper])) {
$t_suffix = '_reservedWord';
- } elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_attrib, $PMA_SQPdata_column_attrib_cnt)) {
+ } elseif (isset($PMA_SQPdata_column_attrib[$d_cur_upper])) {
$t_suffix = '_columnAttrib';
// INNODB is a MySQL table type, but in "SHOW INNODB STATUS",
// it should be regarded as a reserved word.
@@ -764,18 +763,18 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|| ($d_bef_prev_upper == 'SET' && $d_prev_upper == '=')
|| ($d_bef_prev_upper == 'CHARSET' && $d_prev_upper == '=')
|| $d_prev_upper == 'CHARSET'
- ) && PMA_STR_binarySearchInArr($d_cur, $mysql_charsets, count($mysql_charsets))) {
+ ) && in_array($d_cur, $mysql_charsets)) {
$t_suffix = '_charset';
}
- } elseif (PMA_STR_binarySearchInArr($d_cur, $mysql_charsets, $mysql_charsets_count)
- || PMA_STR_binarySearchInArr($d_cur, $mysql_collations_flat, $mysql_collations_count)
- || ($d_cur{0} == '_' && PMA_STR_binarySearchInArr(substr($d_cur, 1), $mysql_charsets, $mysql_charsets_count))) {
+ } elseif (in_array($d_cur, $mysql_charsets)
+ || in_array($d_cur, $mysql_collations_flat)
+ || ($d_cur{0} == '_' && in_array(substr($d_cur, 1), $mysql_charsets))) {
$t_suffix = '_charset';
} else {
// Do nothing
}
// check if present in the list of forbidden words
- if ($t_suffix == '_reservedWord' && PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_forbidden_word, $PMA_SQPdata_forbidden_word_cnt)) {
+ if ($t_suffix == '_reservedWord' && isset($PMA_SQPdata_forbidden_word[$d_cur_upper])) {
$sql_array[$i]['forbidden'] = true;
} else {
$sql_array[$i]['forbidden'] = false;
@@ -988,49 +987,42 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// 'WHERE'
// );
$words_ending_table_ref = array(
- 'FOR',
- 'GROUP',
- 'HAVING',
- 'LIMIT',
- 'LOCK',
- 'ORDER',
- 'PROCEDURE',
- 'UNION',
- 'WHERE'
+ 'FOR' => 1,
+ 'GROUP' => 1,
+ 'HAVING' => 1,
+ 'LIMIT' => 1,
+ 'LOCK' => 1,
+ 'ORDER' => 1,
+ 'PROCEDURE' => 1,
+ 'UNION' => 1,
+ 'WHERE' => 1
);
- $words_ending_table_ref_cnt = 9; //count($words_ending_table_ref);
$words_ending_clauses = array(
- 'FOR',
- 'LIMIT',
- 'LOCK',
- 'PROCEDURE',
- 'UNION'
+ 'FOR' => 1,
+ 'LIMIT' => 1,
+ 'LOCK' => 1,
+ 'PROCEDURE' => 1,
+ 'UNION' => 1
);
- $words_ending_clauses_cnt = 5; //count($words_ending_clauses);
-
-
-
- // must be sorted
$supported_query_types = array(
- 'SELECT'
+ 'SELECT' => 1,
/*
// Support for these additional query types will come later on.
- 'DELETE',
- 'INSERT',
- 'REPLACE',
- 'TRUNCATE',
- 'UPDATE'
- 'EXPLAIN',
- 'DESCRIBE',
- 'SHOW',
- 'CREATE',
- 'SET',
- 'ALTER'
+ 'DELETE' => 1,
+ 'INSERT' => 1,
+ 'REPLACE' => 1,
+ 'TRUNCATE' => 1,
+ 'UPDATE' => 1,
+ 'EXPLAIN' => 1,
+ 'DESCRIBE' => 1,
+ 'SHOW' => 1,
+ 'CREATE' => 1,
+ 'SET' => 1,
+ 'ALTER' => 1
*/
);
- $supported_query_types_cnt = count($supported_query_types);
// loop #1 for each token: select_expr, table_ref for SELECT
@@ -1120,7 +1112,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
} // end if (querytype was empty)
// Check if we support this type of query
- if (!PMA_STR_binarySearchInArr($subresult['querytype'], $supported_query_types, $supported_query_types_cnt)) {
+ if (!isset($supported_query_types[$subresult['querytype']])) {
// Skip ahead to the next one if we don't
$seek_queryend = true;
continue;
@@ -1410,7 +1402,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
if (($i == $size-1)
|| ($arr[$i]['type'] == 'alpha_reservedWord'
&& !$in_group_concat
- && PMA_STR_binarySearchInArr($upper_data, $words_ending_table_ref, $words_ending_table_ref_cnt))) {
+ && isset($words_ending_table_ref[$upper_data]))) {
$seen_end_of_table_ref = true;
// to be able to save the last table ref, but do not
// set it true if we found a word like "ON" that has
@@ -1653,7 +1645,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
}
// if we find one of the words that could end the clause
- if (PMA_STR_binarySearchInArr($upper_data, $words_ending_clauses, $words_ending_clauses_cnt)) {
+ if (isset($words_ending_clauses[$upper_data])) {
$in_group_by = false;
$in_order_by = false;
@@ -2134,51 +2126,46 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$space_alpha_reserved_word = ' ';
$keywords_with_brackets_1before = array(
- 'INDEX',
- 'KEY',
- 'ON',
- 'USING'
+ 'INDEX' => 1,
+ 'KEY' => 1,
+ 'ON' => 1,
+ 'USING' => 1
);
- $keywords_with_brackets_1before_cnt = 4;
$keywords_with_brackets_2before = array(
- 'IGNORE',
- 'INDEX',
- 'INTO',
- 'KEY',
- 'PRIMARY',
- 'PROCEDURE',
- 'REFERENCES',
- 'UNIQUE',
- 'USE'
+ 'IGNORE' => 1,
+ 'INDEX' => 1,
+ 'INTO' => 1,
+ 'KEY' => 1,
+ 'PRIMARY' => 1,
+ 'PROCEDURE' => 1,
+ 'REFERENCES' => 1,
+ 'UNIQUE' => 1,
+ 'USE' => 1
);
- // $keywords_with_brackets_2before_cnt = count($keywords_with_brackets_2before);
- $keywords_with_brackets_2before_cnt = 9;
// These reserved words do NOT get a newline placed near them.
$keywords_no_newline = array(
- 'AS',
- 'ASC',
- 'DESC',
- 'DISTINCT',
- 'DUPLICATE',
- 'HOUR',
- 'INTERVAL',
- 'IS',
- 'LIKE',
- 'NOT',
- 'NULL',
- 'ON',
- 'REGEXP'
+ 'AS' => 1,
+ 'ASC' => 1,
+ 'DESC' => 1,
+ 'DISTINCT' => 1,
+ 'DUPLICATE' => 1,
+ 'HOUR' => 1,
+ 'INTERVAL' => 1,
+ 'IS' => 1,
+ 'LIKE' => 1,
+ 'NOT' => 1,
+ 'NULL' => 1,
+ 'ON' => 1,
+ 'REGEXP' => 1
);
- $keywords_no_newline_cnt = 12;
// These reserved words introduce a privilege list
$keywords_priv_list = array(
- 'GRANT',
- 'REVOKE'
+ 'GRANT' => 1,
+ 'REVOKE' => 1
);
- $keywords_priv_list_cnt = 2;
if ($number_of_tokens == -1) {
$number_of_tokens = $arr['len'];
@@ -2228,9 +2215,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
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))
+ && isset($keywords_with_brackets_2before[strtoupper($arr[$i - 2]['data'])]))
|| (($typearr[1] == 'alpha_reservedWord')
- && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 1]['data']), $keywords_with_brackets_1before, $keywords_with_brackets_1before_cnt))
+ && isset($keywords_with_brackets_1before[strtoupper($arr[$i - 1]['data'])]))
) {
$functionlevel++;
$infunction = true;
@@ -2420,9 +2407,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
if ((($typearr[1] != 'alpha_reservedWord')
|| (($typearr[1] == 'alpha_reservedWord')
- && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 1]['data']), $keywords_no_newline, $keywords_no_newline_cnt)))
+ && isset($keywords_no_newline[strtoupper($arr[$i - 1]['data'])])))
&& ($typearr[1] != 'punct_level_plus')
- && (!PMA_STR_binarySearchInArr($arr[$i]['data'], $keywords_no_newline, $keywords_no_newline_cnt))) {
+ && (!isset($keywords_no_newline[$arr[$i]['data']]))) {
// do not put a space before the first token, because
// we use a lot of pattern matching checking for the
// first reserved word at beginning of query
@@ -2448,7 +2435,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
} else {
// on first keyword, check if it introduces a
// privilege list
- if (PMA_STR_binarySearchInArr($arr[$i]['data'], $keywords_priv_list, $keywords_priv_list_cnt)) {
+ if (isset($keywords_priv_list[$arr[$i]['data']])) {
$in_priv_list = true;
}
}
diff --git a/libraries/string.lib.php b/libraries/string.lib.php
index 650a2efb51..96bfcfc216 100644
--- a/libraries/string.lib.php
+++ b/libraries/string.lib.php
@@ -124,37 +124,4 @@ function PMA_STR_isSqlIdentifier($c, $dot_is_valid = false)
|| ($dot_is_valid != false && $c == '.'));
} // end of the "PMA_STR_isSqlIdentifier()" function
-
-/**
- * Binary search of a value in a sorted array
- *
- * $arr MUST be sorted, due to binary search
- *
- * @param string string to search for
- * @param array sorted array to search into
- * @param integer size of sorted array to search into
- *
- * @return boolean whether the string has been found or not
- */
-function PMA_STR_binarySearchInArr($str, $arr, $arrsize)
-{
- $top = $arrsize - 1;
- $bottom = 0;
- $found = false;
-
- while ($top >= $bottom && $found == false) {
- $mid = intval(($top + $bottom) / 2);
- $res = strcmp($str, $arr[$mid]);
- if ($res == 0) {
- $found = true;
- } elseif ($res < 0) {
- $top = $mid - 1;
- } else {
- $bottom = $mid + 1;
- }
- } // end while
-
- return $found;
-} // end of the "PMA_STR_binarySearchInArr()" function
-
?>
diff --git a/po/ja.po b/po/ja.po
index d495550ee4..7e392a7ea7 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -4,13 +4,13 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 3.5.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2011-06-07 06:41-0400\n"
-"PO-Revision-Date: 2011-06-07 12:48+0200\n"
+"PO-Revision-Date: 2011-06-08 12:19+0200\n"
"Last-Translator: Yuichiro \n"
"Language-Team: japanese \n"
+"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Pootle 2.0.5\n"
@@ -1025,10 +1025,9 @@ msgstr "パスワードが異なっています!"
#: js/messages.php:54 server_privileges.php:1679 server_privileges.php:1703
#: server_privileges.php:2108 server_privileges.php:2302
-#, fuzzy
#| msgid "Any user"
msgid "Add user"
-msgstr "すべてのユーザ"
+msgstr "ユーザを追加する"
#: js/messages.php:55
msgid "Reloading Privileges"
@@ -1100,10 +1099,9 @@ msgid "Create Table"
msgstr "テーブルを作成"
#: js/messages.php:82
-#, fuzzy
#| msgid "Use Tables"
msgid "Insert Table"
-msgstr "利用するテーブル"
+msgstr "テーブルを挿入する"
#: js/messages.php:85
msgid "Searching"
@@ -1664,7 +1662,7 @@ msgstr "テーブル %s を %s にリネームしました"
#: libraries/Table.class.php:1250
msgid "Could not save table UI preferences"
-msgstr ""
+msgstr "テーブルにユーザ設定が保存できません"
#: libraries/Theme.class.php:160
#, php-format
@@ -1792,10 +1790,9 @@ msgstr ""
"ユーザ名ないしパスワードが間違っています。 アクセスは拒否されました"
#: libraries/auth/signon.auth.lib.php:87
-#, fuzzy
#| msgid "Config authentication"
msgid "Can not find signon authentication script:"
-msgstr "Config 認証"
+msgstr "サインオン認証スクリプトが見つかりません:"
#: libraries/auth/swekey/swekey.auth.lib.php:118
#, php-format
@@ -3368,7 +3365,7 @@ msgstr "軽めのタブ"
#: libraries/config/messages.inc.php:292
msgid ""
"Maximum number of characters shown in any non-numeric column on browse view"
-msgstr "ビューに表示される数値でないカラムの表示文字の最大数。"
+msgstr "表示ページにおいて数値でないカラムの表示文字の最大数。"
#: libraries/config/messages.inc.php:293
msgid "Limit column characters"
@@ -4013,7 +4010,6 @@ msgid "Display columns table"
msgstr "表示するカラムためのテーブル"
#: libraries/config/messages.inc.php:426
-#, fuzzy
#| msgid ""
#| "Leave blank for no user preferences storage in database, suggested: [kbd]"
#| "pma_config[/kbd]"
@@ -4021,11 +4017,10 @@ msgid ""
"Leave blank for no \"persistent\" tables'UI preferences across sessions, "
"suggested: [kbd]pma_table_uiprefs[/kbd]"
msgstr ""
-"データベースにユーザ設定の保存しない場合は空欄にします。[kbd]pma_config[/"
-"kbd] としておくのがいいでしょう。"
+"ユーザ設定をセッションを跨いで「永続的に」記憶しない場合は空欄にします。[kbd]pma_table_uiprefs[/kbd] "
+"としておくのがいいでしょう。"
#: libraries/config/messages.inc.php:427
-#, fuzzy
#| msgid "User preferences storage table"
msgid "UI preferences table"
msgstr "ユーザ設定保存テーブル"
@@ -6219,11 +6214,11 @@ msgstr "SQL 履歴"
#: libraries/relation.lib.php:143
#| msgid "Persistent connections"
msgid "Persistent recently used tables"
-msgstr "最近使用したテーブルの永続的な記憶"
+msgstr "永続的な『最近使用したテーブル』"
#: libraries/relation.lib.php:147
msgid "Persistent tables' UI preferences"
-msgstr ""
+msgstr "永続的な『テーブルのユーザ設定』"
#: libraries/relation.lib.php:155
msgid "User preferences"
diff --git a/po/tr.po b/po/tr.po
index 87b6ef2dbf..61c405ce3b 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -4,13 +4,13 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 3.5.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2011-06-07 06:41-0400\n"
-"PO-Revision-Date: 2011-06-06 18:49+0200\n"
+"PO-Revision-Date: 2011-06-08 16:25+0200\n"
"Last-Translator: Burak Yavuz \n"
"Language-Team: turkish