This commit is contained in:
Marc Delisle
2002-07-25 12:29:02 +00:00
parent 209b89b388
commit 2f03dfeca6
9 changed files with 528 additions and 501 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2002-07-25 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* coding standard: common.lib.php3, config.inc.php3, Documentation.html,
header.inc.php3, sqlparser.data.php3, sqlparser.lib.php3,
string.lib.php3, translators.html
2002-07-24 Marc Delisle <lem9@users.sourceforge.net>
* new lang: slovenian, thanks to Kositer Uros (urosh)

View File

@@ -47,7 +47,8 @@ $cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;
* Disable the default warning that is displayed on the DB Details Structure page if
* any of the required Tables for the relationfeatures could not be found
*/
$cfg['PmaNoRelation_DisableWarning'] = FALSE;
$cfg['PmaNoRelation_DisableWarning'] = FALSE;
/**
* Server(s) configuration
@@ -283,6 +284,7 @@ $cfg['ModifyDeleteAtRight'] = FALSE; // show edit/delete links on right s
$cfg['DefaultDisplay'] = 'horizontal'; // default display direction (horizontal|vertical)
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate)
/**
* SQL Parser Settings
*/
@@ -291,24 +293,25 @@ $cfg['SQP']['fmtType'] = 'html'; // Pretty-printing style to use on q
$cfg['SQP']['fmtInd'] = '1'; // Amount to indent each level (floats ok)
$cfg['SQP']['fmtIndUnit'] = 'em'; // Units for indenting each level (CSS Types - {em,px,pt})
$cfg['SQP']['fmtColor'] = array( // Syntax colouring data
'comment' => '#808000',
'digit' => 'inherit',
'digit_hex' => 'teal',
'digit_integer' => 'teal',
'digit_float' => 'aqua',
'punct' => 'fuchsia',
'alpha' => 'inherit',
'alpha_columnType' => '#FF9900',
'comment' => '#808000',
'digit' => 'inherit',
'digit_hex' => 'teal',
'digit_integer' => 'teal',
'digit_float' => 'aqua',
'punct' => 'fuchsia',
'alpha' => 'inherit',
'alpha_columnType' => '#FF9900',
'alpha_columnAttrib' => '#0000FF',
'alpha_reservedWord' => '#990099',
'alpha_functionName' => '#FF0000',
'alpha_identifier' => 'black',
'alpha_variable' => '#800000',
'quote' => '#008000',
'quote_double' => 'inherit',
'quote_single' => 'inherit',
'quote_backtick' => 'inherit'
);
'alpha_identifier' => 'black',
'alpha_variable' => '#800000',
'quote' => '#008000',
'quote_double' => 'inherit',
'quote_single' => 'inherit',
'quote_backtick' => 'inherit'
);
/**
* Available charsets for MySQL conversion. currently contains all which could
@@ -422,6 +425,7 @@ if ($cfg['ShowFunctionFields']) {
);
} // end if
/**
* Unset magic_quotes_runtime - do not change!
*/

View File

@@ -94,7 +94,7 @@ a.h1:visited {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
a.h1:hover {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold; color: #FF0000}
a.drop:link {font-family: <?php echo $right_font_family; ?>; color: #ff0000}
a.drop:visited {font-family: <?php echo $right_font_family; ?>; color: #ff0000}
a.drop:hover {font-family: <?php echo $right_font_family; ?>; color: #ffffff; background-color:#ff0000; text-decoration:none}
a.drop:hover {font-family: <?php echo $right_font_family; ?>; color: #ffffff; background-color:#ff0000; text-decoration: none}
.nav {font-family: <?php echo $right_font_family; ?>; color: #000000}
.warning {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; color: #FF0000}
td.topline {font-size: 1px}
@@ -113,24 +113,24 @@ table.tabs {
border-bottom: 1px solid #666;
}
.syntax { font-family: sans-serif; font-size: small; }
.syntax_comment { }
.syntax_digit { }
.syntax_digit_hex { }
.syntax_digit_integer { }
.syntax_digit_float { }
.syntax_punct { }
.syntax_alpha { text-transform: lowercase; }
.syntax_alpha_columnType { text-transform: uppercase; }
.syntax_alpha_columnAttrib { text-transform: uppercase; }
.syntax_alpha_reservedWord { text-transform: uppercase; font-weight: bold; }
.syntax_alpha_functionName { text-transform: uppercase; }
.syntax_alpha_identifier { }
.syntax_alpha_variable { }
.syntax_quote { }
.syntax_quote_backtick { }
.syntax {font-family: sans-serif; font-size: <?php echo $font_smaller; ?>;}
.syntax_comment {}
.syntax_digit {}
.syntax_digit_hex {}
.syntax_digit_integer {}
.syntax_digit_float {}
.syntax_punct {}
.syntax_alpha {text-transform: lowercase;}
.syntax_alpha_columnType {text-transform: uppercase;}
.syntax_alpha_columnAttrib {text-transform: uppercase;}
.syntax_alpha_reservedWord {text-transform: uppercase; font-weight: bold;}
.syntax_alpha_functionName {text-transform: uppercase;}
.syntax_alpha_identifier {}
.syntax_alpha_variable {}
.syntax_quote {}
.syntax_quote_backtick {}
<?php
echo PMA_SQP_BuildCssData();
echo PMA_SQP_buildCssData();
?>
//-->
</style>

View File

@@ -168,13 +168,13 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
/**
* String handling
*/
include('./libraries/string.lib.php3');
include('./libraries/string.lib.php3');
/**
* SQL Parser data and code
*/
include('./libraries/sqlparser.data.php3');
include('./libraries/sqlparser.lib.php3');
/**
* SQL Parser data and code
*/
include('./libraries/sqlparser.data.php3');
include('./libraries/sqlparser.lib.php3');
// If zlib output compression is set in the php configuration file, no
// output buffering should be run
@@ -240,7 +240,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
/**
* format sql strings
*
* @param struct pre-parsed SQL structure
* @param mixed pre-parsed SQL structure
*
* @return string the formatted sql
*
@@ -251,37 +251,36 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
*
* @author Robin Johnson <robbat2@users.sourceforge.net>
*/
function PMA_format_sql ($ParsedSQL)
function PMA_formatSql($parsed_sql)
{
global $cfg;
// Check that we actually have a valid set of parsed data
// well, not quite
if(!is_array($ParsedSQL)) {
// We don,t so just return the input directly
if (!is_array($parsed_sql)) {
// We don't so just return the input directly
// This is intended to be used for when the SQL Parser is turned off
return $ParsedSQL;
}
return $parsed_sql;
}
$formattedSQL = '';
$formatted_sql = '';
switch($cfg['SQP']['fmtType']) {
switch ($cfg['SQP']['fmtType']) {
case 'none':
$formattedSQL = PMA_SQP_FormatNone($ParsedSQL);
$formatted_sql = PMA_SQP_formatNone($parsed_sql);
break;
case 'html':
$formattedSQL = PMA_SQP_FormatHTML($ParsedSQL);
$formatted_sql = PMA_SQP_formatHtml($parsed_sql);
break;
case 'text':
$formattedSQL = PMA_SQP_FormatText($ParsedSQL);
$formatted_sql = PMA_SQP_formatText($parsed_sql);
break;
default:
break;
}
} // end switch
return $formattedSQL;
} // end of the "PMA_format_sql()" function
} // end of the "PMA_formatSql()" function
/**
@@ -314,7 +313,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$the_query = $GLOBALS['sql_query'];
}
$ParsedSQL = PMA_SQP_Parse($the_query);
$parsed_sql = PMA_SQP_parse($the_query);
echo '<p><b>'. $GLOBALS['strError'] . '</b></p>' . "\n";
// if the config password is wrong, or the MySQL server does not
@@ -330,7 +329,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
} // end if
echo '</p>' . "\n"
. '<p>' . "\n"
. ' ' . PMA_format_sql($ParsedSQL) . "\n"
. ' ' . PMA_formatSql($parsed_sql) . "\n"
. '</p>' . "\n";
} // end if
if (!empty($error_message)) {
@@ -1112,9 +1111,9 @@ if (typeof(document.getElementById) != 'undefined'
$sqlnr = 1;
if (!empty($GLOBALS['show_as_php'])) {
$new_line = '&quot;;<br />' . "\n" . ' $sql .= &quot;';
} /* else if ($cfg['UseSyntaxColoring'] == FALSE) {
$new_line = '<br />' . "\n";
} */
// } else if ($cfg['UseSyntaxColoring'] == FALSE) {
// $new_line = '<br />' . "\n";
}
if (isset($new_line)) {
$query_base = htmlspecialchars($GLOBALS['sql_query']);
$query_base = ereg_replace("((\015\012)|(\015)|(\012))+", $new_line, $query_base);
@@ -1123,10 +1122,10 @@ if (typeof(document.getElementById) != 'undefined'
}
if (!empty($GLOBALS['show_as_php'])) {
$query_base = '$sql = &quot;' . $query_base;
// } else d$if ($cfg['UseSyntaxColoring']) {
// } else if ($cfg['UseSyntaxColoring']) {
} else {
$ParsedSQL = PMA_SQP_Parse($query_base);
$query_base = PMA_format_sql($ParsedSQL);
$parsed_sql = PMA_SQP_parse($query_base);
$query_base = PMA_formatSql($parsed_sql);
}
// Prepares links that may be displayed to edit/explain the query
@@ -1180,7 +1179,7 @@ if (typeof(document.getElementById) != 'undefined'
// If a 'LIMIT' clause has been programatically added to the query
// displays it
if (!empty($GLOBALS['sql_limit_to_append'])) {
echo PMA_format_sql(PMA_SQP_Parse($GLOBALS['sql_limit_to_append']));
echo PMA_formatSql(PMA_SQP_parse($GLOBALS['sql_limit_to_append']));
}
if (!empty($GLOBALS['show_as_php'])) {
echo '&quot;;';

View File

@@ -1,6 +1,7 @@
<?php
/* $Id$ */
/** SQL Parser Matching Data
*
* Copyright 2002 Robin Johnson <robbat2@users.sourceforge.net>
@@ -10,13 +11,12 @@
*
* It has been extracted from the lex.h file in the MySQL BK tree
* (around 4.0.2) as well as the MySQL documentation.
*
*/
if (!defined('PMA_SQP_DATA_INCLUDED')) {
define('PMA_SQP_DATA_INCLUDED', 1);
$PMA_SQPdata_FunctionName = array (
$PMA_SQPdata_function_name = array (
'ABS',
'ACOS',
'ADDDATE',
@@ -152,10 +152,10 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'WEEKDAY',
'YEARWEEK'
);
//$PMA_SQPdata_FunctionNameLen = count($PMA_SQPdata_FunctionName);
$PMA_SQPdata_FunctionNameLen = 134;
//$PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
$PMA_SQPdata_function_name_cnt = 134;
$PMA_SQPdata_ColumnAttrib = array (
$PMA_SQPdata_column_attrib = array (
'AUTO_INCREMENT',
'BDB',
'BERKELEYDB',
@@ -172,10 +172,10 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'VARYING',
'ZEROFILL'
);
//$PMA_SQPdata_ColumnAttribLen = count($PMA_SQPdata_ColumnAttrib);
$PMA_SQPdata_ColumnAttribLen = 15;
//$PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
$PMA_SQPdata_column_attrib_cnt = 15;
$PMA_SQPdata_ReservedWord = array (
$PMA_SQPdata_reserved_word = array (
'ACTION',
'ADD',
'AFTER',
@@ -417,10 +417,10 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'WRITE',
'YEAR_MONTH'
);
//$PMA_SQPdata_ReservedWordLen = count($PMA_SQPdata_ReservedWord);
$PMA_SQPdata_ReservedWordLen = 239;
//$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
$PMA_SQPdata_reserved_word_cnt = 239;
$PMA_SQPdata_ColumnType = array (
$PMA_SQPdata_column_type = array (
'BIGINT',
'BIT',
'BLOB',
@@ -465,10 +465,8 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'VARCHAR',
'YEAR'
);
//$PMA_SQPdata_ColumnTypeLen = count($PMA_SQPdata_ColumnType);
$PMA_SQPdata_ColumnTypeLen = 43;
//$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
$PMA_SQPdata_column_type_cnt = 43;
} // $__PMA_SQP_DATA__
?>

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the needle is in the haystack or not
*/
function PMA_STR_StrInStr($needle, $haystack)
function PMA_STR_strInStr($needle, $haystack)
{
// strpos($haystack, $needle) !== FALSE
// return (is_integer(strpos($haystack, $needle)));
@@ -45,7 +45,7 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the character is escaped or not
*/
function PMA_STR_charIsEscaped($string, $pos, $start=0)
function PMA_STR_charIsEscaped($string, $pos, $start = 0)
{
$len = strlen($string);
// Base case:
@@ -67,7 +67,7 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
}
return $escaped;
} // end of the "PMA_STR_strInStr()" function
} // end of the "PMA_STR_charIsEscaped()" function
/**
@@ -79,10 +79,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the number is in the range or not
*/
function PMA_STR_NumberInRangeInclusive($num, $lower, $upper)
function PMA_STR_numberInRangeInclusive($num, $lower, $upper)
{
return (($num >= $lower) && ($num <= $upper));
} // end of the "PMA_STR_NumberInRangeInclusive()" function
} // end of the "PMA_STR_numberInRangeInclusive()" function
/**
@@ -92,16 +92,16 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the character is a digit or not
*
* @see PMA_STR_NumberInRangeInclusive()
* @see PMA_STR_numberInRangeInclusive()
*/
function PMA_STR_IsDigit($c)
function PMA_STR_isDigit($c)
{
$ord_zero = 48; //ord('0');
$ord_nine = 57; //ord('9');
$ord_c = ord($c);
return PMA_STR_NumberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_IsDigit()" function
return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_isDigit()" function
/**
@@ -111,9 +111,9 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the character is an hexadecimal digit or not
*
* @see PMA_STR_NumberInRangeInclusive()
* @see PMA_STR_numberInRangeInclusive()
*/
function PMA_STR_IsHexDigit($c)
function PMA_STR_isHexDigit($c)
{
$ord_Aupper = 65; //ord('A');
$ord_Fupper = 70; //ord('F');
@@ -123,10 +123,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
$ord_nine = 57; //ord('9');
$ord_c = ord($c);
return (PMA_STR_NumberInRangeInclusive($ord_c, $ord_zero, $ord_nine)
|| PMA_STR_NumberInRangeInclusive($ord_c, $ord_Aupper, $ord_Fupper)
|| PMA_STR_NumberInRangeInclusive($ord_c, $ord_Alower, $ord_Flower));
} // end of the "PMA_STR_IsHexDigit()" function
return (PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine)
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_Aupper, $ord_Fupper)
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_Alower, $ord_Flower));
} // end of the "PMA_STR_isHexDigit()" function
/**
@@ -137,16 +137,16 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* @return boolean whether the character is an upper alphabetic one or
* not
*
* @see PMA_STR_NumberInRangeInclusive()
* @see PMA_STR_numberInRangeInclusive()
*/
function PMA_STR_IsUpper($c)
function PMA_STR_isUpper($c)
{
$ord_zero = 65; //ord('A');
$ord_nine = 90; //ord('Z');
$ord_c = ord($c);
return PMA_STR_NumberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_IsUpper()" function
return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_isUpper()" function
/**
@@ -157,16 +157,16 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* @return boolean whether the character is a lower alphabetic one or
* not
*
* @see PMA_STR_NumberInRangeInclusive()
* @see PMA_STR_numberInRangeInclusive()
*/
function PMA_STR_IsLower($c)
function PMA_STR_isLower($c)
{
$ord_zero = 97; //ord('a');
$ord_nine = 122; //ord('z');
$ord_c = ord($c);
return PMA_STR_NumberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_IsLower()" function
return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_isLower()" function
/**
@@ -176,13 +176,13 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the character is an alphabetic one or not
*
* @see PMA_STR_IsUpper()
* @see PMA_STR_IsLower()
* @see PMA_STR_isUpper()
* @see PMA_STR_isLower()
*/
function PMA_STR_IsAlpha($c)
function PMA_STR_isAlpha($c)
{
return (PMA_STR_IsUpper($c) || PMA_STR_IsLower($c));
} // end of the "PMA_STR_IsAlpha()" function
return (PMA_STR_isUpper($c) || PMA_STR_isLower($c));
} // end of the "PMA_STR_isAlpha()" function
/**
@@ -192,14 +192,14 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the character is an alphanumeric one or not
*
* @see PMA_STR_IsUpper()
* @see PMA_STR_IsLower()
* @see PMA_STR_IsDigit()
* @see PMA_STR_isUpper()
* @see PMA_STR_isLower()
* @see PMA_STR_isDigit()
*/
function PMA_STR_IsAlnum($c)
function PMA_STR_isAlnum($c)
{
return (PMA_STR_IsUpper($c) || PMA_STR_IsLower($c) || PMA_STR_IsDigit($c));
} // end of the "PMA_STR_IsAlnum()" function
return (PMA_STR_isUpper($c) || PMA_STR_isLower($c) || PMA_STR_isDigit($c));
} // end of the "PMA_STR_isAlnum()" function
/**
@@ -209,18 +209,18 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the character is a space one or not
*
* @see PMA_STR_NumberInRangeInclusive()
* @see PMA_STR_numberInRangeInclusive()
*/
function PMA_STR_IsSpace($c)
function PMA_STR_isSpace($c)
{
$ord_space = 32; //ord(' ')
$ord_tab = 9; //ord('\t')
$ord_CR = 13; //ord('\n')
$ord_c = ord($c);
$ord_tab = 9; //ord('\t')
$ord_CR = 13; //ord('\n')
$ord_c = ord($c);
return (($ord_c == $ord_space)
|| PMA_STR_NumberInRangeInclusive($ord_c, $ord_tab, $ord_CR));
} // end of the "PMA_STR_IsSpace()" function
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_tab, $ord_CR));
} // end of the "PMA_STR_isSpace()" function
/**
@@ -231,14 +231,14 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*
* @return boolean whether the character is an SQL identifier or not
*
* @see PMA_STR_IsAlnum()
* @see PMA_STR_isAlnum()
*/
function PMA_STR_IsSqlIdentifier($c, $dot_is_valid = FALSE)
function PMA_STR_isSqlIdentifier($c, $dot_is_valid = FALSE)
{
return (PMA_STR_IsAlnum($c)
return (PMA_STR_isAlnum($c)
|| ($c == '_') || ($c == '$')
|| (($dot_is_valid != FALSE) && ($c == '.')));
} // end of the "PMA_STR_IsSqlIdentifier()" function
} // end of the "PMA_STR_isSqlIdentifier()" function
/**

View File

@@ -311,7 +311,6 @@
</td>
</tr>
<tr>
<tr>
<td>Slovenian</td>
<td>