Skip to content

Commit

Permalink
Clarify function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Delisle committed May 26, 2013
1 parent fc851a2 commit b8e4f34
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions libraries/Table.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ static public function moveCopy($source_db, $source_table, $target_db,
}

/* Generate query back */
$sql_structure = PMA_SQP_formatHtml($parsed_sql, 'query_only');
$sql_structure = PMA_SQP_format($parsed_sql, 'query_only');
// If table exists, and 'add drop table' is selected: Drop it!
$drop_query = '';
if (isset($_REQUEST['drop_if_exists'])
Expand Down Expand Up @@ -967,7 +967,7 @@ static public function moveCopy($source_db, $source_table, $target_db,
}

// Generate query back
$GLOBALS['sql_constraints_query'] = PMA_SQP_formatHtml(
$GLOBALS['sql_constraints_query'] = PMA_SQP_format(
$parsed_sql, 'query_only'
);
if ($mode == 'one_table') {
Expand Down
4 changes: 2 additions & 2 deletions libraries/Util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ public static function formatSql($parsed_sql, $unparsed_sql = '')
}
break;
case 'html':
$formatted_sql = PMA_SQP_formatHtml($parsed_sql, 'color');
$formatted_sql = PMA_SQP_format($parsed_sql, 'color');
break;
case 'text':
$formatted_sql = PMA_SQP_formatHtml($parsed_sql, 'text');
$formatted_sql = PMA_SQP_format($parsed_sql, 'text');
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function getInfo()
*/
public function applyTransformation($buffer, $options = array(), $meta = '')
{
$result = PMA_SQP_formatHtml(PMA_SQP_parse($buffer));
$result = PMA_SQP_format(PMA_SQP_parse($buffer));
// Need to clear error state not to break subsequent queries display.
PMA_SQP_resetError();
return $result;
Expand Down Expand Up @@ -78,4 +78,4 @@ public static function getName()
return "SQL";
}
}
?>
?>
2 changes: 1 addition & 1 deletion libraries/rte/rte_routines.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ function PMA_RTN_handleExecute()

// Pass the SQL queries through the "pretty printer"
$output = '<code class="sql" style="margin-bottom: 1em;">';
$output .= PMA_SQP_formatHtml(
$output .= PMA_SQP_format(
PMA_SQP_parse(implode($queries)),
'text'
);
Expand Down
10 changes: 5 additions & 5 deletions libraries/sqlparser.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* from the analyzer.
*
* If you want a pretty-printed version of the query, do:
* $string = PMA_SQP_formatHtml($parsed_sql);
* $string = PMA_SQP_format($parsed_sql);
* (note that that you need to have syntax.css.php included somehow in your
* page for it to work, I recommend '<link rel="stylesheet" type="text/css"
* href="syntax.css.php" />' at the moment.)
Expand Down Expand Up @@ -2174,18 +2174,18 @@ function PMA_SQP_formatHtml_colorize($arr)


/**
* Formats SQL queries to html
* Formats SQL queries
*
* @param array $arr The SQL queries
* @param string $mode mode of printing
* @param string $mode formatting mode
* @param integer $start_token starting token
* @param integer $number_of_tokens number of tokens to format, -1 = all
*
* @return string The formatted SQL queries
*
* @access public
*/
function PMA_SQP_formatHtml(
function PMA_SQP_format(
$arr, $mode='color', $start_token=0,
$number_of_tokens=-1
) {
Expand Down Expand Up @@ -2916,7 +2916,7 @@ function PMA_SQP_formatHtml(
}

return $str;
} // end of the "PMA_SQP_formatHtml()" function
} // end of the "PMA_SQP_format()" function

/**
* Gets SQL queries with no format
Expand Down
2 changes: 1 addition & 1 deletion server_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ function PMA_getTableProcesslistHtml($ServerStatusData)
if (! $show_full_sql && strlen($process['Info']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
$retval .= htmlspecialchars(substr($process['Info'], 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'])) . '[...]';
} else {
$retval .= PMA_SQP_formatHtml(PMA_SQP_parse($process['Info']));
$retval .= PMA_SQP_format(PMA_SQP_parse($process['Info']));
}
}
$retval .= '</td>';
Expand Down
4 changes: 2 additions & 2 deletions sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,15 @@
// take the left part, could be:
// SELECT
// (SELECT
$count_query = PMA_SQP_formatHtml(
$count_query = PMA_SQP_format(
$parsed_sql,
'query_only',
0,
$analyzed_sql[0]['position_of_first_select'] + 1
);
$count_query .= ' SQL_CALC_FOUND_ROWS ';
// add everything that was after the first SELECT
$count_query .= PMA_SQP_formatHtml(
$count_query .= PMA_SQP_format(
$parsed_sql,
'query_only',
$analyzed_sql[0]['position_of_first_select'] + 1
Expand Down

0 comments on commit b8e4f34

Please sign in to comment.