Little code reorganistaion (RFE #957308), removed some remaining php3 compatibility code in SQL parser.
This commit is contained in:
@@ -28,7 +28,7 @@ $comment_marker = '-- ';
|
||||
function PMA_fieldTypes($db, $table,$use_backquotes) {
|
||||
PMA_DBI_select_db($db);
|
||||
$table_def = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table));
|
||||
while($row = PMA_DBI_fetch_assoc($table_def)) {
|
||||
while ($row = PMA_DBI_fetch_assoc($table_def)) {
|
||||
$types[PMA_backquote($row['Field'],$use_backquotes)] = ereg_replace('\\(.*', '', $row['Type']);
|
||||
}
|
||||
return $types;
|
||||
@@ -340,7 +340,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
|
||||
if (isset($comments_map) && count($comments_map) > 0) {
|
||||
$schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf
|
||||
. $GLOBALS['comment_marker'] . $GLOBALS['strCommentsForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf;
|
||||
foreach($comments_map AS $comment_field => $comment) {
|
||||
foreach ($comments_map AS $comment_field => $comment) {
|
||||
$schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($comment_field, $use_backquotes) . $crlf
|
||||
. $GLOBALS['comment_marker'] . ' ' . PMA_backquote($comment, $use_backquotes) . $crlf;
|
||||
}
|
||||
@@ -351,7 +351,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
|
||||
$schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf
|
||||
. $GLOBALS['comment_marker'] . $GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf;
|
||||
@reset($mime_map);
|
||||
foreach($mime_map AS $mime_field => $mime) {
|
||||
foreach ($mime_map AS $mime_field => $mime) {
|
||||
$schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($mime_field, $use_backquotes) . $crlf
|
||||
. $GLOBALS['comment_marker'] . ' ' . PMA_backquote($mime['mimetype'], $use_backquotes) . $crlf;
|
||||
}
|
||||
@@ -361,7 +361,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
|
||||
if ($have_rel) {
|
||||
$schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf
|
||||
. $GLOBALS['comment_marker'] . $GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf;
|
||||
foreach($res_rel AS $rel_field => $rel) {
|
||||
foreach ($res_rel AS $rel_field => $rel) {
|
||||
$schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($rel_field, $use_backquotes) . $crlf
|
||||
. $GLOBALS['comment_marker'] . ' ' . PMA_backquote($rel['foreign_table'], $use_backquotes)
|
||||
. ' -> ' . PMA_backquote($rel['foreign_field'], $use_backquotes) . $crlf;
|
||||
|
Reference in New Issue
Block a user