Resolve conflicts due to changes in method names of common.lib.php

This commit is contained in:
Chanaka Indrajith 2012-05-13 12:39:31 +05:30
commit dd237eb924
41 changed files with 337 additions and 302 deletions

View File

@ -1599,9 +1599,6 @@ class PMA_Config
function setCookie($cookie, $value, $default = null, $validity = null,
$httponly = true
) {
if ($validity == null) {
$validity = 2592000;
}
if (strlen($value) && null !== $default && $value === $default) {
// default value is used
if (isset($_COOKIE[$cookie])) {
@ -1619,10 +1616,12 @@ class PMA_Config
if (! isset($_COOKIE[$cookie]) || $_COOKIE[$cookie] !== $value) {
// set cookie with new value
/* Calculate cookie validity */
if ($validity == 0) {
$v = 0;
if ($validity == null) {
$validity = time() + 2592000;
} elseif ($validity == 0) {
$validity = 0;
} else {
$v = time() + $validity;
$validity = time() + $validity;
}
if (defined('TESTSUITE')) {
$_COOKIE[$cookie] = $value;
@ -1631,7 +1630,7 @@ class PMA_Config
return setcookie(
$cookie,
$value,
$v,
$validity,
$this->getCookiePath(),
'',
$this->isHttps(),

View File

@ -239,7 +239,7 @@ class PMA_File
}
/**
*
* Loads uploaded file from table change request.
*
* @param string $key the md5 hash of the column name
* @param string $rownumber
@ -252,7 +252,11 @@ class PMA_File
if (! isset($_FILES['fields_upload']) || empty($_FILES['fields_upload']['name']['multi_edit'][$rownumber][$key])) {
return false;
}
$file = PMA_File::fetchUploadedFromTblChangeRequestMultiple($_FILES['fields_upload'], $rownumber, $key);
$file = PMA_File::fetchUploadedFromTblChangeRequestMultiple(
$_FILES['fields_upload'],
$rownumber,
$key
);
// check for file upload errors
switch ($file['error']) {
@ -344,13 +348,17 @@ class PMA_File
&& is_string($_REQUEST['fields_uploadlocal']['multi_edit'][$rownumber][$key])
) {
// ... whether with multiple rows ...
return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal']['multi_edit'][$rownumber][$key]);
return $this->setLocalSelectedFile(
$_REQUEST['fields_uploadlocal']['multi_edit'][$rownumber][$key]
);
} else {
return false;
}
}
/**
* Returns possible error message.
*
* @access public
* @return string error message
*/
@ -360,6 +368,8 @@ class PMA_File
}
/**
* Checks whether there was any error.
*
* @access public
* @return boolean whether an error occured or not
*/
@ -395,6 +405,7 @@ class PMA_File
}
/**
* Sets named file to be read from UploadDir.
*
* @param string $name
*
@ -407,7 +418,9 @@ class PMA_File
return false;
}
$this->setName(PMA_userDir($GLOBALS['cfg']['UploadDir']) . PMA_securePath($name));
$this->setName(
PMA_userDir($GLOBALS['cfg']['UploadDir']) . PMA_securePath($name)
);
if (! $this->isReadable()) {
$this->_error_message = __('File could not be read');
$this->setName(null);
@ -418,6 +431,8 @@ class PMA_File
}
/**
* Checks whether file can be read.
*
* @access public
* @return boolean whether the file is readable or not
*/
@ -452,12 +467,18 @@ class PMA_File
return false;
}
$new_file_to_upload = tempnam(realpath($GLOBALS['cfg']['TempDir']), basename($this->getName()));
$new_file_to_upload = tempnam(
realpath($GLOBALS['cfg']['TempDir']),
basename($this->getName())
);
// suppress warnings from being displayed, but not from being logged
// any file access outside of open_basedir will issue a warning
ob_start();
$move_uploaded_file_result = move_uploaded_file($this->getName(), $new_file_to_upload);
$move_uploaded_file_result = move_uploaded_file(
$this->getName(),
$new_file_to_upload
);
ob_end_clean();
if (! $move_uploaded_file_result) {
$this->_error_message = __('Error while moving uploaded file.');
@ -559,6 +580,8 @@ class PMA_File
}
/**
* Attempts to open the file.
*
* @return bool
*/
function open()
@ -625,6 +648,8 @@ class PMA_File
}
/**
* Returns compression used by file.
*
* @return string MIME type of compression, none for none
* @access public
*/

View File

@ -204,7 +204,7 @@ class PMA_List_Database extends PMA_List
// thus containing not escaped _ or %
if (! preg_match('/(^|[^\\\\])(_|%)/', $each_only_db)) {
// ... not contains wildcard
$items[] = PMA_unescape_mysql_wildcards($each_only_db);
$items[] = PMA_unescapeMysqlWildcards($each_only_db);
continue;
}

View File

@ -111,7 +111,7 @@ class PMA_Menu
} else {
$tabs = $this->_getServerTabs();
}
return PMA_generate_html_tabs($tabs, $url_params);
return PMA_generateHtmlTabs($tabs, $url_params);
}
/**

View File

@ -576,18 +576,14 @@ function PMA_auth_set_user()
$url_params['target'] = $GLOBALS['target'];
}
/**
* whether we come from a fresh cookie login
*/
define('PMA_COMING_FROM_COOKIE_LOGIN', true);
/**
* Clear user cache.
*/
PMA_clearUserCache();
PMA_sendHeaderLocation(
$redirect_url . PMA_generate_common_url($url_params, '&')
$redirect_url . PMA_generate_common_url($url_params, '&'),
true
);
exit();
} // end if

View File

@ -11,7 +11,7 @@
*
* @return string Function name.
*/
function PMA_detect_pow()
function PMA_detectPow()
{
if (function_exists('bcpow')) {
// BCMath Arbitrary Precision Mathematics Function
@ -39,7 +39,7 @@ function PMA_pow($base, $exp, $use_function = false)
static $pow_function = null;
if (null == $pow_function) {
$pow_function = PMA_detect_pow();
$pow_function = PMA_detectPow();
}
if (! $use_function) {
@ -263,10 +263,10 @@ function PMA_sqlAddSlashes($a_string = '', $is_like = false, $crlf = false,
*
* @access public
*/
function PMA_escape_mysql_wildcards($name)
function PMA_escapeMysqlWildcards($name)
{
return strtr($name, array('_' => '\\_', '%' => '\\%'));
} // end of the 'PMA_escape_mysql_wildcards()' function
} // end of the 'PMA_escapeMysqlWildcards()' function
/**
* removes slashes before "_" and "%" characters
@ -278,10 +278,10 @@ function PMA_escape_mysql_wildcards($name)
*
* @access public
*/
function PMA_unescape_mysql_wildcards($name)
function PMA_unescapeMysqlWildcards($name)
{
return strtr($name, array('\\_' => '_', '\\%' => '%'));
} // end of the 'PMA_unescape_mysql_wildcards()' function
} // end of the 'PMA_unescapeMysqlWildcards()' function
/**
* removes quotes (',",`) from a quoted string
@ -531,7 +531,7 @@ function PMA_showPHPDocu($target)
* returns HTML for a footnote marker and add the messsage to the footnotes
*
* @param string $message the error message
* @param bool $bbcode
* @param bool $bbcode whether to interpret BB code
* @param string $type message types
*
* @return string html code for a footnote marker
@ -600,7 +600,7 @@ function PMA_mysqlDie(
*/
include_once './libraries/header.inc.php';
$error_msg_output = '';
$error_msg = '';
if (! $error_message) {
$error_message = PMA_DBI_getError();
@ -625,8 +625,8 @@ function PMA_mysqlDie(
}
}
// ---
$error_msg_output .= "\n" . '<!-- PMA-SQL-ERROR -->' . "\n";
$error_msg_output .= ' <div class="error"><h1>' . __('Error')
$error_msg .= "\n" . '<!-- PMA-SQL-ERROR -->' . "\n";
$error_msg .= ' <div class="error"><h1>' . __('Error')
. '</h1>' . "\n";
// if the config password is wrong, or the MySQL server does not
// respond, do not show the query that would reveal the
@ -634,15 +634,15 @@ function PMA_mysqlDie(
if (! empty($the_query) && ! strstr($the_query, 'connect')) {
// --- Added to solve bug #641765
if (function_exists('PMA_SQP_isError') && PMA_SQP_isError()) {
$error_msg_output .= PMA_SQP_getErrorString() . "\n";
$error_msg_output .= '<br />' . "\n";
$error_msg .= PMA_SQP_getErrorString() . "\n";
$error_msg .= '<br />' . "\n";
}
// ---
// modified to show the help on sql errors
$error_msg_output .= ' <p><strong>' . __('SQL query') . ':</strong>' . "\n";
$error_msg .= '<p><strong>' . __('SQL query') . ':</strong>' . "\n";
if (strstr(strtolower($formatted_sql), 'select')) {
// please show me help to the error on select
$error_msg_output .= PMA_showMySQLDocu('SQL-Syntax', 'SELECT');
$error_msg .= PMA_showMySQLDocu('SQL-Syntax', 'SELECT');
}
if ($is_modify_link) {
$_url_params = array(
@ -663,14 +663,14 @@ function PMA_mysqlDie(
. PMA_generate_common_url($_url_params) . '">';
}
$error_msg_output .= $doedit_goto
$error_msg .= $doedit_goto
. PMA_getIcon('b_edit.png', __('Edit'))
. '</a>';
} // end if
$error_msg_output .= ' </p>' . "\n"
.' <p>' . "\n"
.' ' . $formatted_sql . "\n"
.' </p>' . "\n";
$error_msg .= ' </p>' . "\n"
.'<p>' . "\n"
. $formatted_sql . "\n"
. '</p>' . "\n";
} // end if
if (! empty($error_message)) {
@ -682,7 +682,7 @@ function PMA_mysqlDie(
}
// modified to show the help on error-returns
// (now error-messages-server)
$error_msg_output .= '<p>' . "\n"
$error_msg .= '<p>' . "\n"
. ' <strong>' . __('MySQL said: ') . '</strong>'
. PMA_showMySQLDocu('Error-messages-server', 'Error-messages-server')
. "\n"
@ -699,12 +699,12 @@ function PMA_mysqlDie(
// Replace linebreaks
$error_message = nl2br($error_message);
$error_msg_output .= '<code>' . "\n"
$error_msg .= '<code>' . "\n"
. $error_message . "\n"
. '</code><br />' . "\n";
$error_msg_output .= '</div>';
$error_msg .= '</div>';
$_SESSION['Import_message']['message'] = $error_msg_output;
$_SESSION['Import_message']['message'] = $error_msg;
if ($exit) {
/**
@ -713,7 +713,7 @@ function PMA_mysqlDie(
* - use PMA_ajaxResponse() to transmit the message and exit
*/
if ($GLOBALS['is_ajax_request'] == true) {
PMA_ajaxResponse($error_msg_output, false);
PMA_ajaxResponse($error_msg, false);
}
if (! empty($back_url)) {
if (strstr($back_url, '?')) {
@ -724,18 +724,18 @@ function PMA_mysqlDie(
$_SESSION['Import_message']['go_back_url'] = $back_url;
$error_msg_output .= '<fieldset class="tblFooters">';
$error_msg_output .= '[ <a href="' . $back_url . '">' . __('Back') . '</a> ]';
$error_msg_output .= '</fieldset>' . "\n\n";
$error_msg .= '<fieldset class="tblFooters">';
$error_msg .= '[ <a href="' . $back_url . '">' . __('Back') . '</a> ]';
$error_msg .= '</fieldset>' . "\n\n";
}
echo $error_msg_output;
echo $error_msg;
/**
* display footer and exit
*/
include './libraries/footer.inc.php';
} else {
echo $error_msg_output;
echo $error_msg;
}
} // end of the 'PMA_mysqlDie()' function
@ -791,7 +791,12 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0,
$tbl_is_view = $table['TABLE_TYPE'] == 'VIEW';
if ($tbl_is_view || PMA_is_system_schema($db)) {
$table['Rows'] = PMA_Table::countRecords($db, $table['Name'], false, true);
$table['Rows'] = PMA_Table::countRecords(
$db,
$table['Name'],
false,
true
);
}
}
@ -933,7 +938,7 @@ function PMA_whichCrlf()
*
* @access public
*/
function PMA_reloadNavigation($jsonly=false)
function PMA_reloadNavigation($jsonly = false)
{
// Reloads the navigation frame via JavaScript if required
if (isset($GLOBALS['reload']) && $GLOBALS['reload']) {
@ -943,19 +948,21 @@ function PMA_reloadNavigation($jsonly=false)
// and the offset becomes greater than the total number of tables
unset($_SESSION['tmp_user_values']['table_limit_offset']);
echo "\n";
$reload_url = './navigation.php?' . PMA_generate_common_url($GLOBALS['db'], '', '&');
$reload_url = './navigation.php?' . PMA_generate_common_url(
$GLOBALS['db'],
'',
'&'
);
if (!$jsonly) {
echo '<script type="text/javascript">' . PHP_EOL;
}
?>
//<![CDATA[
if (typeof(window.parent) != 'undefined'
&& typeof(window.parent.frame_navigation) != 'undefined'
&& window.parent.goTo) {
window.parent.goTo('<?php echo $reload_url; ?>');
}
//]]>
<?php
echo '//<![CDATA[' . PHP_EOL;
echo 'if (typeof(window.parent) != "undefined"' . PHP_EOL;
echo ' && typeof(window.parent.frame_navigation) != "undefined"' . PHP_EOL;
echo ' && window.parent.goTo) {' . PHP_EOL;
echo ' window.parent.goTo("' . $reload_url . '");' . PHP_EOL;
echo '}' . PHP_EOL;
echo '//]]>' . PHP_EOL;
if (!$jsonly) {
echo '</script>' . PHP_EOL;
}
@ -1013,25 +1020,14 @@ function PMA_getMessage(
$retval .= "\n";
$retval .= '<script type="text/javascript">' . "\n";
$retval .= '//<![CDATA[' . "\n";
$retval .= "if (window.parent.updateTableTitle) window.parent.updateTableTitle('"
$retval .= 'if (window.parent.updateTableTitle) {' . "\n";
$retval .= " window.parent.updateTableTitle('"
. $uni_tbl . "', '" . PMA_jsFormat($tooltip, false) . "');" . "\n";
$retval .= '}' . "\n";
$retval .= '//]]>' . "\n";
$retval .= '</script>' . "\n";
} // end if ... elseif
// Checks if the table needs to be repaired after a TRUNCATE query.
// @todo what about $GLOBALS['display_query']???
// @todo this is REALLY the wrong place to do this - very unexpected here
if (strlen($GLOBALS['table'])
&& $GLOBALS['sql_query'] == 'TRUNCATE TABLE ' . PMA_backquote($GLOBALS['table'])
) {
if (PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], 'Index_length') > 1024
&& ! PMA_DRIZZLE
) {
PMA_DBI_try_query('REPAIR TABLE ' . PMA_backquote($GLOBALS['table']));
}
}
// In an Ajax request, $GLOBALS['cell_align_left'] may not be defined. Hence,
// check for it's presence before using it
$retval .= '<div id="result_query"'
@ -1501,7 +1497,7 @@ function PMA_formatNumber(
$value, $digits_left = 3, $digits_right = 0,
$only_down = false, $noTrailingZero = true
) {
if ($value==0) {
if ($value == 0) {
return '0';
}
@ -1559,11 +1555,11 @@ function PMA_formatNumber(
*/
$cur_digits = floor(log10($value / PMA_pow(1000, $d, 'pow'))+1);
if ($digits_left > $cur_digits) {
$d-= floor(($digits_left - $cur_digits)/3);
$d -= floor(($digits_left - $cur_digits)/3);
}
if ($d<0 && $only_down) {
$d=0;
if ($d < 0 && $only_down) {
$d = 0;
}
$value = round($value / (PMA_pow(1000, $d, 'pow') / $dh)) /$dh;
@ -1579,7 +1575,7 @@ function PMA_formatNumber(
$value = PMA_localizeNumber(number_format($value, $digits_right));
}
if ($originalValue!=0 && floatval($value) == 0) {
if ($originalValue != 0 && floatval($value) == 0) {
return ' <' . (1 / PMA_pow(10, $digits_right)) . ' ' . $unit;
}
@ -1695,7 +1691,7 @@ function PMA_localisedDate($timestamp = -1, $format = '')
*
* @access public
*/
function PMA_generate_html_tab($tab, $url_params = array())
function PMA_generateHtmlTab($tab, $url_params = array())
{
// default values
$defaults = array(
@ -1786,7 +1782,7 @@ function PMA_generate_html_tab($tab, $url_params = array())
$out .= '</li>';
return $out;
} // end of the 'PMA_generate_html_tab()' function
} // end of the 'PMA_generateHtmlTab()' function
/**
* returns html-code for a tab navigation
@ -1797,14 +1793,14 @@ function PMA_generate_html_tab($tab, $url_params = array())
*
* @return string html-code for tab-navigation
*/
function PMA_generate_html_tabs($tabs, $url_params, $menu_id = 'topmenu')
function PMA_generateHtmlTabs($tabs, $url_params, $menu_id = 'topmenu')
{
$tab_navigation = '<div id="' . htmlentities($menu_id)
. 'container" class="menucontainer">'
.'<ul id="' . htmlentities($menu_id) . '">';
foreach ($tabs as $tab) {
$tab_navigation .= PMA_generate_html_tab($tab, $url_params);
$tab_navigation .= PMA_generateHtmlTab($tab, $url_params);
}
$tab_navigation .=
@ -2211,7 +2207,7 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row,
$condition = '';
}
} elseif ($meta->type == 'bit') {
$con_val = "= b'" . PMA_printable_bit_value($row[$i], $meta->length) . "'";
$con_val = "= b'" . PMA_printableBitValue($row[$i], $meta->length) . "'";
} else {
$con_val = '= \'' . PMA_sqlAddSlashes($row[$i], false, true) . '\'';
}
@ -2559,7 +2555,7 @@ function PMA_getDbLink($database = null)
}
$database = $GLOBALS['db'];
} else {
$database = PMA_unescape_mysql_wildcards($database);
$database = PMA_unescapeMysqlWildcards($database);
}
return '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?'
@ -2873,7 +2869,7 @@ function PMA_cacheUnset($var, $server = 0)
*
* @return string the printable value
*/
function PMA_printable_bit_value($value, $length)
function PMA_printableBitValue($value, $length)
{
$printable = '';
for ($i = 0, $len_ceiled = ceil($length / 8); $i < $len_ceiled; $i++) {
@ -2890,7 +2886,7 @@ function PMA_printable_bit_value($value, $length)
*
* @return boolean
*/
function PMA_contains_nonprintable_ascii($value)
function PMA_containsNonPrintableAscii($value)
{
return preg_match('@[^[:print:]]@', $value);
}
@ -2903,7 +2899,7 @@ function PMA_contains_nonprintable_ascii($value)
*
* @return string the converted value
*/
function PMA_convert_bit_default_value($bit_default_value)
function PMA_convertBitDefaultValue($bit_default_value)
{
return strtr($bit_default_value, array("b" => "", "'" => ""));
}
@ -3062,7 +3058,7 @@ function PMA_extractColumnSpec($columnspec)
*
* @return boolean
*/
function PMA_foreignkey_supported($engine)
function PMA_isForeignKeySupported($engine)
{
$engine = strtoupper($engine);
if ('INNODB' == $engine || 'PBXT' == $engine) {
@ -3079,7 +3075,7 @@ function PMA_foreignkey_supported($engine)
*
* @return string the content with characters replaced
*/
function PMA_replace_binary_contents($content)
function PMA_replaceBinaryContents($content)
{
$result = str_replace("\x00", '\0', $content);
$result = str_replace("\x08", '\b', $result);

View File

@ -506,11 +506,12 @@ function PMA_getenv($var_name)
/**
* Send HTTP header, taking IIS limits into account (600 seems ok)
*
* @param string $uri the header to send
* @param string $uri the header to send
* @param bool $use_refresh whether to use Refresh: header when running on IIS
*
* @return boolean always true
*/
function PMA_sendHeaderLocation($uri)
function PMA_sendHeaderLocation($uri, $use_refresh = false)
{
if (PMA_IS_IIS && strlen($uri) > 600) {
include_once './libraries/js_escape.lib.php';
@ -557,7 +558,7 @@ function PMA_sendHeaderLocation($uri)
// bug #1523784: IE6 does not like 'Refresh: 0', it
// results in a blank page
// but we need it when coming from the cookie login panel)
if (PMA_IS_IIS && defined('PMA_COMING_FROM_COOKIE_LOGIN')) {
if (PMA_IS_IIS && $use_refresh) {
header('Refresh: 0; ' . $uri);
} else {
header('Location: ' . $uri);

View File

@ -372,10 +372,10 @@ function PMA_DBI_get_tables_full($database, $table = false,
if ($table) {
if (true === $tbl_is_group) {
$sql_where_table = 'AND t.`TABLE_NAME` LIKE \''
. PMA_escape_mysql_wildcards(PMA_sqlAddSlashes($table)) . '%\'';
. PMA_escapeMysqlWildcards(PMA_sqlAddSlashes($table)) . '%\'';
} elseif ('comment' === $tbl_is_group) {
$sql_where_table = 'AND t.`TABLE_COMMENT` LIKE \''
. PMA_escape_mysql_wildcards(PMA_sqlAddSlashes($table)) . '%\'';
. PMA_escapeMysqlWildcards(PMA_sqlAddSlashes($table)) . '%\'';
} else {
$sql_where_table = 'AND t.`TABLE_NAME` = \'' . PMA_sqlAddSlashes($table) . '\'';
}
@ -509,7 +509,7 @@ function PMA_DBI_get_tables_full($database, $table = false,
if ($table || (true === $tbl_is_group)) {
$sql = 'SHOW TABLE STATUS FROM '
. PMA_backquote($each_database)
.' LIKE \'' . PMA_escape_mysql_wildcards(PMA_sqlAddSlashes($table, true)) . '%\'';
.' LIKE \'' . PMA_escapeMysqlWildcards(PMA_sqlAddSlashes($table, true)) . '%\'';
} else {
$sql = 'SHOW TABLE STATUS FROM '
. PMA_backquote($each_database);

View File

@ -113,7 +113,7 @@ $tables = array();
// When used in Nested table group mode,
// only show tables matching the given groupname
if (PMA_isValid($tbl_group) && !$cfg['ShowTooltipAliasTB']) {
$tbl_group_sql = ' LIKE "' . PMA_escape_mysql_wildcards($tbl_group) . '%"';
$tbl_group_sql = ' LIKE "' . PMA_escapeMysqlWildcards($tbl_group) . '%"';
} else {
$tbl_group_sql = '';
}

View File

@ -474,7 +474,7 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
.'">';
$table_navigation_html .= PMA_generate_common_hidden_inputs($db, $table);
$table_navigation_html .= '<input type="hidden" name="sql_query" '
. 'value="' . $html_sql_query . '" />'
. '<input type="hidden" name="goto" value="' . $goto . '" />'
@ -491,7 +491,7 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
? $_SESSION['tmp_user_values']['max_rows']
: $GLOBALS['cfg']['MaxRows'])
. '" class="textfield" onfocus="this.select()" />';
if ($GLOBALS['cfg']['ShowDisplayDirection']) {
// Display mode (horizontal/vertical and repeat headers)
$table_navigation_html .= __('Mode') . ': ' . "\n";
@ -737,6 +737,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
'goto' => $goto,
'display_options_form' => 1
);
$table_headers_html .= PMA_generate_common_hidden_inputs($url_params)
. '<br />'
. PMA_getDivForSliderEffect('displayoptions', __('Options'))
@ -747,6 +748,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
'P' => __('Partial texts'),
'F' => __('Full texts')
);
$table_headers_html .= PMA_getRadioFields(
'display_text', $choices,
$_SESSION['tmp_user_values']['display_text']
@ -789,6 +791,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
'K' => __('Relational key'),
'D' => __('Relational display column')
);
$table_headers_html .= PMA_getRadioFields(
'relational_display', $choices,
$_SESSION['tmp_user_values']['relational_display']
@ -831,6 +834,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
'WKT' => __('Well Known Text'),
'WKB' => __('Well Known Binary')
);
$table_headers_html .= PMA_getRadioFields(
'geometry_display', $choices,
$_SESSION['tmp_user_values']['geometry_display']
@ -1972,12 +1976,12 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$where_comparison = ' = ' . $row[$i];
if ($_SESSION['tmp_user_values']['display_binary_as_hex']
&& PMA_contains_nonprintable_ascii($row[$i])
&& PMA_containsNonPrintableAscii($row[$i])
) {
$wkbval = PMA_substr(bin2hex($row[$i]), 8);
} else {
$wkbval = htmlspecialchars(
PMA_replace_binary_contents($row[$i])
PMA_replaceBinaryContents($row[$i])
);
}
@ -2036,9 +2040,11 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$field_flags = PMA_DBI_field_flags($dt_result, $i);
$formatted = false;
if (isset($meta->_type) && $meta->_type === MYSQLI_TYPE_BIT) {
$row[$i] = PMA_printable_bit_value(
$row[$i] = PMA_printableBitValue(
$row[$i], $meta->length
);
// some results of PROCEDURE ANALYSE() are reported as
// being BINARY but they are quite readable,
// so don't treat them as BINARY
@ -2050,12 +2056,12 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// user asked to see the real contents of BINARY
// fields
if ($_SESSION['tmp_user_values']['display_binary_as_hex']
&& PMA_contains_nonprintable_ascii($row[$i])
&& PMA_containsNonPrintableAscii($row[$i])
) {
$row[$i] = bin2hex($row[$i]);
} else {
$row[$i] = htmlspecialchars(
PMA_replace_binary_contents($row[$i])
PMA_replaceBinaryContents($row[$i])
);
}
} else {
@ -2776,11 +2782,6 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
PMA_DBI_data_seek($dt_result, $num_rows - 1);
$row = PMA_DBI_fetch_row($dt_result);
// $clause_is_unique is needed by PMA_getTable() to generate the proper param
// in the multi-edit and multi-delete form
list($where_clause, $clause_is_unique, $condition_array)
= PMA_getUniqueCondition($dt_result, $fields_cnt, $fields_meta, $row);
// check for non printable sorted row data
$meta = $fields_meta[$sorted_column_index];
if (stristr($meta->type, 'BLOB') || $meta->type == 'geometry') {
@ -3036,6 +3037,18 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
$table_html .= '<input type="hidden" name="url_query"'
.' value="' . $GLOBALS['url_query'] . '" />' . "\n";
}
// fetch last row of the result set
PMA_DBI_data_seek($dt_result, $num_rows - 1);
$row = PMA_DBI_fetch_row($dt_result);
// $clause_is_unique is needed by PMA_getTable() to generate the proper param
// in the multi-edit and multi-delete form
list($where_clause, $clause_is_unique, $condition_array)
= PMA_getUniqueCondition($dt_result, $fields_cnt, $fields_meta, $row);
// reset to first row for the loop in PMA_getTableBody()
PMA_DBI_data_seek($dt_result, 0);
$table_html .= '<input type="hidden" name="clause_is_unique"'
.' value="' . $clause_is_unique . '" />' . "\n";
@ -3291,7 +3304,7 @@ function PMA_handleNonPrintableContents($category, $content, $transform_function
&& $_SESSION['tmp_user_values']['display_blob']
) {
// in this case, restart from the original $content
$result = htmlspecialchars(PMA_replace_binary_contents($content));
$result = htmlspecialchars(PMA_replaceBinaryContents($content));
}
/* Create link to download */
if (count($url_params) > 0) {

View File

@ -1576,7 +1576,7 @@ if (isset($plugin_list)) {
} elseif ($fields_meta[$j]->type == 'bit') {
// detection of 'bit' works only on mysqli extension
$values[] = "b'" . PMA_sqlAddSlashes(
PMA_printable_bit_value(
PMA_printableBitValue(
$row[$j], $fields_meta[$j]->length
)
)

View File

@ -210,7 +210,7 @@ function get_script_tabs()
'var h_tabs = new Array();' . "\n" ;
for ($i = 0, $cnt = count($GLOBALS['PMD']['TABLE_NAME']); $i < $cnt; $i++) {
$script_tabs .= "j_tabs['" . $GLOBALS['PMD_URL']['TABLE_NAME'][$i] . "'] = '"
. (PMA_foreignkey_supported($GLOBALS['PMD']['TABLE_TYPE'][$i]) ? '1' : '0') . "';\n";
. (PMA_isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i]) ? '1' : '0') . "';\n";
$script_tabs .="h_tabs['" . $GLOBALS['PMD_URL']['TABLE_NAME'][$i] . "'] = 1;"."\n" ;
}
$script_tabs .=

View File

@ -690,7 +690,7 @@ class PMA_User_Schema
$tables = PMA_DBI_get_tables_full($db);
$foreignkey_tables = array();
foreach ($tables as $table_name => $table_properties) {
if (PMA_foreignkey_supported($table_properties['ENGINE'])) {
if (PMA_isForeignKeySupported($table_properties['ENGINE'])) {
$foreignkey_tables[] = $table_name;
}
}

View File

@ -285,7 +285,7 @@ for ($i = 0; $i < $num_fields; $i++) {
if (isset($row['Type'])) {
$extracted_columnspec = PMA_extractColumnSpec($row['Type']);
if ($extracted_columnspec['type'] == 'bit') {
$row['Default'] = PMA_convert_bit_default_value($row['Default']);
$row['Default'] = PMA_convertBitDefaultValue($row['Default']);
}
}
// Cell index: If certain fields get left out, the counter shouldn't change.
@ -399,7 +399,7 @@ for ($i = 0; $i < $num_fields; $i++) {
}
if ($type_upper == 'BIT') {
$row['DefaultValue'] = PMA_convert_bit_default_value($row['DefaultValue']);
$row['DefaultValue'] = PMA_convertBitDefaultValue($row['DefaultValue']);
}
$content_cells[$i][$ci] = '<select name="field_default_type[' . $i

View File

@ -23,7 +23,7 @@ $tabs_icons = array(
'Import' => 'b_import.png',
'Export' => 'b_export.png');
echo '<ul id="topmenu2">';
echo PMA_generate_html_tab(
echo PMA_generateHtmlTab(
array(
'link' => 'prefs_manage.php',
'text' => __('Manage your settings')
@ -37,7 +37,7 @@ foreach (array_keys($forms) as $formset) {
'text' => PMA_lang('Form_' . $formset),
'icon' => $tabs_icons[$formset],
'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param));
echo PMA_generate_html_tab($tab, array('form' => $formset)) . "\n";
echo PMA_generateHtmlTab($tab, array('form' => $formset)) . "\n";
}
echo '</ul><div class="clearfloat"></div>';

View File

@ -279,7 +279,7 @@ for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++
onmouseout="this.className = old_class;"
onmousedown="Click_field('<?php
echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',";
if (! PMA_foreignkey_supported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
if (! PMA_isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
} else {
// if foreign keys are supported, it's not necessary that the

View File

@ -20,7 +20,7 @@ $tables = PMA_DBI_get_tables_full($db, $T2);
$type_T2 = strtoupper($tables[$T2]['ENGINE']);
// native foreign key
if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) && $type_T1 == $type_T2) {
if (PMA_isForeignKeySupported($type_T1) && PMA_isForeignKeySupported($type_T2) && $type_T1 == $type_T2) {
// relation exists?
$existrel_foreign = PMA_getForeigners($db, $T2, '', 'foreign');
if (isset($existrel_foreign[$F2])

View File

@ -24,7 +24,7 @@ $type_T2 = strtoupper($tables[$T2]['ENGINE']);
$try_to_delete_internal_relation = false;
if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) && $type_T1 == $type_T2) {
if (PMA_isForeignKeySupported($type_T1) && PMA_isForeignKeySupported($type_T2) && $type_T1 == $type_T2) {
// InnoDB
$existrel_foreign = PMA_getForeigners($DB2, $T2, '', 'foreign');

View File

@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: phpMyAdmin-docs 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-05-09 13:14+0200\n"
"PO-Revision-Date: 2012-05-03 13:43+0200\n"
"PO-Revision-Date: 2012-05-11 18:22+0200\n"
"Last-Translator: Marc Delisle <marc@infomarc.info>\n"
"Language-Team: none\n"
"Language: fr\n"
@ -12,7 +12,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Weblate 0.10\n"
"X-Generator: Weblate 1.0\n"
#: browse_foreigners.php:35 browse_foreigners.php:59 js/messages.php:358
#: libraries/display_tbl.lib.php:399 server_privileges.php:1828
@ -3073,24 +3073,21 @@ msgstr "Une collection d'objets de géométrie de tout type"
#: libraries/Types.class.php:619 libraries/Types.class.php:971
msgctxt "numeric types"
msgid "Numeric"
msgstr ""
msgstr "Numérique"
#: libraries/Types.class.php:638 libraries/Types.class.php:974
#, fuzzy
#| msgid "Both date and time."
msgctxt "date and time types"
msgid "Date and time"
msgstr "À la fois la date et l'heure."
msgstr "Contient la date et l'heure"
#: libraries/Types.class.php:647 libraries/Types.class.php:977
#, fuzzy
#| msgid "Linestring"
msgctxt "string types"
msgid "String"
msgstr "Ligne"
msgstr "Chaîne de caractères"
#: libraries/Types.class.php:668
#, fuzzy
#| msgid "Spatial"
msgctxt "spatial types"
msgid "Spatial"
@ -7378,7 +7375,7 @@ msgstr "Fichier de formes ESRI"
#: libraries/import/shp.php:199
#, php-format
msgid "Geometry type '%s' is not supported by MySQL."
msgstr ""
msgstr "Le type géométrique '%s' n'est pas supporté par MySQL."
#: libraries/import/shp.php:360
#, php-format

139
po/pt.po
View File

@ -4,15 +4,15 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-05-09 13:14+0200\n"
"PO-Revision-Date: 2012-03-27 16:56+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"PO-Revision-Date: 2012-05-11 14:59+0200\n"
"Last-Translator: Vítor Martins <vjmartins@sapo.pt>\n"
"Language-Team: portuguese <pt@li.org>\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 0.8\n"
"X-Generator: Weblate 1.0\n"
#: browse_foreigners.php:35 browse_foreigners.php:59 js/messages.php:358
#: libraries/display_tbl.lib.php:399 server_privileges.php:1828
@ -239,7 +239,7 @@ msgstr "Ver o esquema da base de dados"
#: db_export.php:30 db_printview.php:95 db_qbe.php:104 db_tracking.php:47
#: export.php:374 navigation.php:287
msgid "No tables found in database."
msgstr "Nenhuma tabela encontrada na base de dados"
msgstr "Nenhuma tabela encontrada na base de dados."
#: db_export.php:40 db_search.php:334 server_export.php:22
msgid "Select All"
@ -472,7 +472,7 @@ msgstr "Adicionar/Remover Colunas"
#: db_qbe.php:634 db_qbe.php:657
msgid "Update Query"
msgstr "Actualiza Comando SQL"
msgstr "Atualizar consulta"
#: db_qbe.php:640
msgid "Use Tables"
@ -481,11 +481,11 @@ msgstr "Usar Tabelas"
#: db_qbe.php:663
#, php-format
msgid "SQL query on database <b>%s</b>:"
msgstr "Comando SQL na base de dados <b>%s</b>:"
msgstr "Consulta SQL na base de dados <b>%s</b>:"
#: db_qbe.php:956 libraries/common.lib.php:1239
msgid "Submit Query"
msgstr "Executar Comando SQL"
msgstr "Executar Consulta"
#: db_search.php:31 libraries/auth/config.auth.lib.php:78
#: libraries/auth/config.auth.lib.php:99
@ -504,7 +504,7 @@ msgstr "todas as palavras"
#: db_search.php:45 db_search.php:303
msgid "the exact phrase"
msgstr "a frase exacta"
msgstr "a frase exata"
#: db_search.php:46 db_search.php:304
msgid "as regular expression"
@ -528,7 +528,7 @@ msgstr[1] "%s resultados na tabela <i>%s</i>"
#: libraries/common.lib.php:3148 libraries/common.lib.php:3378
#: libraries/common.lib.php:3379 tbl_structure.php:573
msgid "Browse"
msgstr "Visualizar"
msgstr "Procurar"
#: db_search.php:252
#, php-format
@ -1403,7 +1403,7 @@ msgstr "slow_query_log está ativo"
#: js/messages.php:146
msgid "slow_query_log and general_log are disabled."
msgstr "slow_query_log e general_log estão inativos"
msgstr "slow_query_log e general_log estão desativados."
#: js/messages.php:147
msgid "log_output is not set to TABLE."
@ -1494,7 +1494,7 @@ msgstr "Dividido por %s:"
#: js/messages.php:168
msgid "Unit"
msgstr ""
msgstr "Unidade"
#: js/messages.php:170
msgid "From slow log"
@ -1557,14 +1557,13 @@ msgstr "Sem bases de dados"
#: js/messages.php:181
msgid "Log analysed, but no data found in this time span."
msgstr ""
"Registo analisado, mas nenhuns dados encontrados neste período de tempo"
"Registo analisado, mas não foram encontrados dados neste período de tempo"
#: js/messages.php:183
msgid "Analyzing..."
msgstr "Em análise..."
#: js/messages.php:184
#, fuzzy
#| msgid "Explain SQL"
msgid "Explain output"
msgstr "Explicar SQL"
@ -1584,7 +1583,6 @@ msgid "Profiling results"
msgstr "Resultado(s) da(s) consulta(s)"
#: js/messages.php:189
#, fuzzy
#| msgid "Table"
msgctxt "Display format"
msgid "Table"
@ -1657,12 +1655,11 @@ msgid "Affected rows:"
msgstr "Linhas afetadas:"
#: js/messages.php:210
#, fuzzy
#| msgid "Failed parsing config file. It doesn't seem to be valid JSON code"
msgid "Failed parsing config file. It doesn't seem to be valid JSON code."
msgstr ""
"Falha ao processar ficheiro de configuração. Não parece ser código JSON "
"válido"
"válido."
#: js/messages.php:211
msgid ""
@ -1844,7 +1841,7 @@ msgid "ENUM/SET editor"
msgstr "Editor ENUM/SET"
#: js/messages.php:273
#, fuzzy, php-format
#, php-format
#| msgid "Values for the column \"%s\""
msgid "Values for column %s"
msgstr "Valores para a coluna \"%s\""
@ -1854,7 +1851,6 @@ msgid "Values for a new column"
msgstr "Valores para a nova coluna"
#: js/messages.php:275
#, fuzzy
#| msgid "Enter each value in a separate field."
msgid "Enter each value in a separate field"
msgstr "Introduza cada valor num campo separado."
@ -1879,7 +1875,7 @@ msgstr "Mostrar Caixa do query"
#: js/messages.php:285 tbl_row_action.php:21
msgid "No rows selected"
msgstr "Nenhum registo (linha) seleccionado."
msgstr "Nenhum registo(linha) seleccionado."
#: js/messages.php:286 libraries/display_tbl.lib.php:3007 querywindow.php:88
#: tbl_structure.php:145 tbl_structure.php:579
@ -1918,25 +1914,23 @@ msgstr "Pesquisa Avançada"
#: js/messages.php:300
msgid "Each point represents a data row."
msgstr "Cada ponto representa um registo (linha) de dados"
msgstr "Cada ponto representa um registo (linha) de dados."
#: js/messages.php:302
#, fuzzy
msgid "Hovering over a point will show its label."
msgstr "Colocar o cursor por cima de um ponto irá mostrar a sua etiqueta"
msgstr "Colocar o cursor por cima de um ponto irá mostrar a sua legenda."
#: js/messages.php:304
msgid "Use mousewheel to zoom in or out of the plot."
msgstr "Use a roda do rato para ampliar ou reduzir a imagem no plano"
msgstr "Use a roda do rato para ampliar ou reduzir a imagem no plano."
#: js/messages.php:306
msgid "Click and drag the mouse to navigate the plot."
msgstr "Clique e arraste com o rato para navegar no mapa"
msgstr "Clique e arraste com o rato para navegar no mapa."
#: js/messages.php:308
#, fuzzy
msgid "Click reset zoom link to come back to original state."
msgstr "Clique no link \"Reset Zoom\" para voltar ao estado original"
msgstr "Clique no link \"Reset Zoom\" para voltar ao estado original."
#: js/messages.php:310
msgid "Click a data point to view and possibly edit the data row."
@ -1966,9 +1960,8 @@ msgid "Query results"
msgstr "Resultado(s) das(s) consulta(s)"
#: js/messages.php:319
#, fuzzy
msgid "Data point content"
msgstr "Tipo de Exportação"
msgstr "Conteúdo do ponto de dados"
#: js/messages.php:322 tbl_change.php:323 tbl_indexes.php:237
#: tbl_indexes.php:272
@ -2044,20 +2037,20 @@ msgid "Click the drop-down arrow<br />to toggle column's visibility"
msgstr "Clique na seta<br />para alternar a visibilidade da coluna"
#: js/messages.php:359
#, fuzzy
msgid ""
"This table does not contain a unique column. Features related to the grid "
"edit, checkbox, Edit, Copy and Delete links may not work after saving."
msgstr ""
"Esta tabela não contem uma única coluna. Opções relacionadas aos links "
"'Editar', 'Marcar', 'Editar', 'Copiar' e 'Apagar' podem não funcionar mais "
"após esta ser salva"
"Esta tabela não contém uma coluna exclusiva. Funções relacionados com a "
"edição da tabela, checkbox, Editar, Copiar e Eliminar links podem não "
"funcionar depois de guardar."
#: js/messages.php:360
msgid ""
"You can also edit most columns<br />by clicking directly on their content."
msgstr ""
"Também pode editar algumas colunas<br/>clicando directamente no seu conteúdo"
"Também pode editar algumas colunas<br/>clicando directamente no seu "
"conteúdo."
#: js/messages.php:361
msgid "Go to link"
@ -2088,16 +2081,14 @@ msgid "Generate"
msgstr "Gerar"
#: js/messages.php:369
#, fuzzy
#| msgid "Change password"
msgid "Change Password"
msgstr "Alterar a palavra-passe"
#: js/messages.php:372 tbl_structure.php:467
#, fuzzy
#| msgid "Mon"
msgid "More"
msgstr "Seg"
msgstr "Mais"
#: js/messages.php:375 setup/lib/index.lib.php:176
#, php-format
@ -2123,18 +2114,16 @@ msgid "Done"
msgstr "Concluído"
#: js/messages.php:401
#, fuzzy
#| msgid "Previous"
msgctxt "Previous month"
msgid "Prev"
msgstr "Anterior"
msgstr "Ant"
#: js/messages.php:406
#, fuzzy
#| msgid "Next"
msgctxt "Next month"
msgid "Next"
msgstr "Próximo"
msgstr "Próx"
#. l10n: Display text for current month link in calendar
#: js/messages.php:409
@ -2315,52 +2304,45 @@ msgstr "Sab"
#. l10n: Minimal week day name
#: js/messages.php:491
#, fuzzy
#| msgid "Sun"
msgid "Su"
msgstr "Dom"
#. l10n: Minimal week day name
#: js/messages.php:493
#, fuzzy
#| msgid "Mon"
msgid "Mo"
msgstr "Seg"
#. l10n: Minimal week day name
#: js/messages.php:495
#, fuzzy
#| msgid "Tue"
msgid "Tu"
msgstr "Ter"
#. l10n: Minimal week day name
#: js/messages.php:497
#, fuzzy
#| msgid "Wed"
msgid "We"
msgstr "Qua"
#. l10n: Minimal week day name
#: js/messages.php:499
#, fuzzy
#| msgid "Thu"
msgid "Th"
msgstr "Qui"
#. l10n: Minimal week day name
#: js/messages.php:501
#, fuzzy
#| msgid "Fri"
msgid "Fr"
msgstr "Sex"
#. l10n: Minimal week day name
#: js/messages.php:503
#, fuzzy
#| msgid "Sat"
msgid "Sa"
msgstr "Sab"
msgstr "Sáb"
#. l10n: Column header for week of the year in calendar
#: js/messages.php:507
@ -2374,7 +2356,6 @@ msgstr ""
#. l10n: Year suffix for calendar, "none" is empty.
#: js/messages.php:512
#, fuzzy
#| msgid "None"
msgctxt "Year suffix"
msgid "none"
@ -2745,12 +2726,11 @@ msgid "There are no recent tables"
msgstr "Não existem tabelas recentes"
#: libraries/StorageEngine.class.php:207
#, fuzzy
msgid ""
"There is no detailed status information available for this storage engine."
msgstr ""
"Não existe nenhuma informação detalhada disponível do estado desta "
"ferramenta de armazenamento"
"Não está disponível nenhuma informação detalhada para este mecanismo de "
"armazenamento."
#: libraries/StorageEngine.class.php:347
#, php-format
@ -2763,9 +2743,9 @@ msgid "%s has been disabled for this MySQL server."
msgstr "%s está desactivado neste servidor MySQL."
#: libraries/StorageEngine.class.php:354
#, fuzzy, php-format
#, php-format
msgid "This MySQL server does not support the %s storage engine."
msgstr "Este servidor MySQL não suporta o stored engine %s."
msgstr "Este servidor MySQL não suporta o mecanismo de armazenamento %s."
#: libraries/Table.class.php:353
msgid "unknown table status: "
@ -2835,9 +2815,8 @@ msgid "No preview available."
msgstr "Nenhuma pré-visualização disponível."
#: libraries/Theme.class.php:362
#, fuzzy
msgid "take it"
msgstr "tome"
msgstr "seleccionar"
#: libraries/Theme_Manager.class.php:114
#, php-format
@ -3197,8 +3176,7 @@ msgstr "Entrada"
#: libraries/auth/cookie.auth.lib.php:230
#: libraries/auth/cookie.auth.lib.php:231
msgid "You can enter hostname/IP address and port separated by space."
msgstr ""
"Pode digitar a hiperligação/endereço de IP e a porta separados por um espaço"
msgstr "Pode digitar a nome/Endereço IP e a porta separados por um espaço."
#: libraries/auth/cookie.auth.lib.php:230
msgid "Server:"
@ -3317,7 +3295,6 @@ msgid "Check Privileges"
msgstr "Verificar Privilégios"
#: libraries/common.inc.php:156
#, fuzzy
msgid "possible exploit"
msgstr "possível 'exploit'"
@ -3487,9 +3464,8 @@ msgid "%s days, %s hours, %s minutes and %s seconds"
msgstr "%s dias, %s horas, %s minutos e %s segundos"
#: libraries/common.lib.php:2092
#, fuzzy
msgid "Missing parameter:"
msgstr "Parâmetros perdidos:"
msgstr "Parâmetros em falta:"
#: libraries/common.lib.php:2472 libraries/common.lib.php:2475
#: libraries/display_tbl.lib.php:330
@ -3500,7 +3476,6 @@ msgstr "Início"
#: libraries/common.lib.php:2473 libraries/common.lib.php:2476
#: libraries/display_tbl.lib.php:333 server_binlog.php:130
#: server_binlog.php:132
#, fuzzy
#| msgid "Previous"
msgctxt "Previous page"
msgid "Previous"
@ -3509,7 +3484,6 @@ msgstr "Anterior"
#: libraries/common.lib.php:2503 libraries/common.lib.php:2506
#: libraries/display_tbl.lib.php:413 server_binlog.php:165
#: server_binlog.php:167
#, fuzzy
#| msgid "Next"
msgctxt "Next page"
msgid "Next"
@ -3517,7 +3491,6 @@ msgstr "Seguinte"
#: libraries/common.lib.php:2504 libraries/common.lib.php:2507
#: libraries/display_tbl.lib.php:437
#, fuzzy
#| msgid "End"
msgctxt "Last page"
msgid "End"
@ -3570,9 +3543,8 @@ msgid "Both"
msgstr "Ambos"
#: libraries/config.values.php:57
#, fuzzy
msgid "Nowhere"
msgstr "Lugar nenhum"
msgstr "Em nenhum lugar"
#: libraries/config.values.php:58
msgid "Left"
@ -3600,9 +3572,8 @@ msgstr "Desactidado"
#: libraries/export/latex.php:58 libraries/export/mediawiki.php:40
#: libraries/export/odt.php:42 libraries/export/sql.php:153
#: libraries/export/texytext.php:36
#, fuzzy
msgid "structure"
msgstr "Estrutura"
msgstr "estrutura"
#: libraries/config.values.php:130 libraries/export/htmlword.php:38
#: libraries/export/latex.php:59 libraries/export/mediawiki.php:41
@ -3615,10 +3586,9 @@ msgstr "dados"
#: libraries/export/latex.php:60 libraries/export/mediawiki.php:42
#: libraries/export/odt.php:44 libraries/export/sql.php:155
#: libraries/export/texytext.php:38
#, fuzzy
#| msgid "Structure and data"
msgid "structure and data"
msgstr "Estrutura e dados"
msgstr "estrutura e dados"
#: libraries/config.values.php:134
msgid "Quick - display only the minimal options to configure"
@ -3636,7 +3606,7 @@ msgstr "Personalizada - como acima, mas sem a escolha rápida/personalizada"
#, fuzzy
#| msgid "Complete inserts"
msgid "complete inserts"
msgstr "Instrucções de inserção completas"
msgstr "Instruções de introdução completas"
#: libraries/config.values.php:165
#, fuzzy
@ -3777,9 +3747,8 @@ msgstr ""
"falha de segurança [/strong], que permite ataques de script cross-frame"
#: libraries/config/messages.inc.php:22
#, fuzzy
msgid "Allow third party framing"
msgstr "Permitir framing de terceiros"
msgstr "Permitir elaboração de terceiros"
#: libraries/config/messages.inc.php:23
msgid "Show &quot;Drop database&quot; link to normal users"
@ -3975,17 +3944,16 @@ msgid "Show binary contents as HEX"
msgstr "Mostrar conteúdo binário como HEX"
#: libraries/config/messages.inc.php:62
#, fuzzy
msgid "Show database listing as a list instead of a drop down"
msgstr ""
"Mostrar listagem de bases de dados como uma lista em vez de um menu drop bown"
"Mostrar listagem de bases de dados como uma lista em vez de um menu drop "
"down"
#: libraries/config/messages.inc.php:63
msgid "Display databases as a list"
msgstr "Mostrar bases de dados como uma lista"
#: libraries/config/messages.inc.php:64
#, fuzzy
msgid "Show server listing as a list instead of a drop down"
msgstr ""
"Mostrar lista de servidores como uma lista ao invés de um menu drop down"
@ -3999,8 +3967,8 @@ msgid ""
"Disable the table maintenance mass operations, like optimizing or repairing "
"the selected tables of a database."
msgstr ""
"Desactivar operações em massa de manutenção de tabelas, como optimizar ou "
"reparar as tabelas seleccionadas de uma base de dados"
"Desativar operações em massa de manutenção de tabelas, como optimizar ou "
"reparar as tabelas seleccionadas de uma base de dados."
#: libraries/config/messages.inc.php:67
msgid "Disable multi table maintenance"
@ -4039,9 +4007,8 @@ msgid "Save as file"
msgstr "envia"
#: libraries/config/messages.inc.php:75 libraries/config/messages.inc.php:247
#, fuzzy
msgid "Character set of the file"
msgstr "Configurar o Mapa de Caracteres do ficheiro:"
msgstr "Configurar o Mapa de Caracteres do ficheiro"
#: libraries/config/messages.inc.php:76 libraries/config/messages.inc.php:92
#: tbl_gis_visualization.php:174 tbl_printview.php:360 tbl_structure.php:908
@ -8505,8 +8472,9 @@ msgid ""
"There seems to be an error in your SQL query. The MySQL server error output "
"below, if there is any, may also help you in diagnosing the problem"
msgstr ""
"Parece haver um erro no seu query SQL. A saída do servidor MySQL abaixo, "
"isto se existir alguma, também o poderá ajudar a diagnosticar o problema."
"Parece haver um erro na sua consulta SQL. A mensagem de erro do servidor "
"MySQL abaixo, isto se existir alguma, também o poderá ajudar a diagnosticar "
"o problema."
#: libraries/sqlparser.lib.php:176
msgid ""
@ -8745,8 +8713,8 @@ msgid ""
"Displays a clickable thumbnail. The options are the maximum width and height "
"in pixels. The original aspect ratio is preserved."
msgstr ""
"Mostra uma miniatura clicável; opções: largura,altura em pixeis (mantém a "
"proporção original)"
"Mostra uma miniatura clicável. As opções são largura e altura máximas em "
"pixeis. A proporção original é preservada."
#: libraries/transformations/image_jpeg__link.inc.php:13
msgid "Displays a link to download this image."
@ -11939,8 +11907,9 @@ msgid "dynamic"
msgstr "dinâmico"
#: tbl_printview.php:389 tbl_structure.php:956
#, fuzzy
msgid "Row length"
msgstr "Comprim. dos reg."
msgstr "Comprimento de linha"
#: tbl_printview.php:402 tbl_structure.php:964
msgid "Row size"

View File

@ -155,7 +155,7 @@ require_once 'libraries/header_scripts.inc.php';
<?php
if ($tabs) {
echo PMA_generate_html_tabs($tabs, array());
echo PMA_generateHtmlTabs($tabs, array());
unset($tabs);
}

View File

@ -149,7 +149,7 @@ if (PMA_isValid($_REQUEST['pred_dbname'])) {
}
if (isset($dbname)) {
$db_and_table = PMA_backquote(PMA_unescape_mysql_wildcards($dbname)) . '.';
$db_and_table = PMA_backquote(PMA_unescapeMysqlWildcards($dbname)) . '.';
if (isset($tablename)) {
$db_and_table .= PMA_backquote($tablename);
} else {
@ -208,7 +208,7 @@ function PMA_wildcardEscapeForGrant($dbname, $tablename)
} else {
if (strlen($tablename)) {
$db_and_table
= PMA_backquote(PMA_unescape_mysql_wildcards($dbname)) . '.'
= PMA_backquote(PMA_unescapeMysqlWildcards($dbname)) . '.'
. PMA_backquote($tablename);
} else {
$db_and_table = PMA_backquote($dbname) . '.*';
@ -524,14 +524,14 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true)
$sql_query = "SELECT * FROM `mysql`.`db`"
." WHERE `User` = '" . PMA_sqlAddSlashes($username) . "'"
." AND `Host` = '" . PMA_sqlAddSlashes($hostname) . "'"
." AND '" . PMA_unescape_mysql_wildcards($db) . "'"
." AND '" . PMA_unescapeMysqlWildcards($db) . "'"
." LIKE `Db`;";
} else {
$sql_query = "SELECT `Table_priv`"
." FROM `mysql`.`tables_priv`"
." WHERE `User` = '" . PMA_sqlAddSlashes($username) . "'"
." AND `Host` = '" . PMA_sqlAddSlashes($hostname) . "'"
." AND `Db` = '" . PMA_unescape_mysql_wildcards($db) . "'"
." AND `Db` = '" . PMA_unescapeMysqlWildcards($db) . "'"
." AND `Table_name` = '" . PMA_sqlAddSlashes($table) . "';";
}
$row = PMA_DBI_fetch_single_row($sql_query);
@ -586,7 +586,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true)
// get collumns
$res = PMA_DBI_try_query(
'SHOW COLUMNS FROM '
. PMA_backquote(PMA_unescape_mysql_wildcards($db))
. PMA_backquote(PMA_unescapeMysqlWildcards($db))
. '.' . PMA_backquote($table) . ';'
);
$columns = array();
@ -613,7 +613,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true)
.' AND `Host`'
.' = \'' . PMA_sqlAddSlashes($hostname) . "'"
.' AND `Db`'
.' = \'' . PMA_sqlAddSlashes(PMA_unescape_mysql_wildcards($db)) . "'"
.' = \'' . PMA_sqlAddSlashes(PMA_unescapeMysqlWildcards($db)) . "'"
.' AND `Table_name`'
.' = \'' . PMA_sqlAddSlashes($table) . '\';'
);
@ -1186,7 +1186,7 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) {
}
$q = 'GRANT ALL PRIVILEGES ON '
. PMA_backquote(PMA_escape_mysql_wildcards(PMA_sqlAddSlashes($username))) . '.* TO \''
. PMA_backquote(PMA_escapeMysqlWildcards(PMA_sqlAddSlashes($username))) . '.* TO \''
. PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';';
$sql_query .= $q;
if (! PMA_DBI_try_query($q)) {
@ -2125,7 +2125,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
// only Db names in the table `mysql`.`db` uses wildcards
// as we are in the db specific rights display we want
// all db names escaped, also from other sources
$db_rights_row['Db'] = PMA_escape_mysql_wildcards(
$db_rights_row['Db'] = PMA_escapeMysqlWildcards(
$db_rights_row['Db']
);
$db_rights[$db_rights_row['Db']] = $db_rights_row;
@ -2282,7 +2282,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
echo ' <select name="pred_dbname" class="autosubmit">' . "\n"
. ' <option value="" selected="selected">' . __('Use text field') . ':</option>' . "\n";
foreach ($pred_db_array as $current_db) {
$current_db = PMA_escape_mysql_wildcards($current_db);
$current_db = PMA_escapeMysqlWildcards($current_db);
// cannot use array_diff() once, outside of the loop,
// because the list of databases has special characters
// already escaped in $found_rows,
@ -2299,7 +2299,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
} else {
echo ' <input type="hidden" name="dbname" value="' . htmlspecialchars($dbname) . '"/>' . "\n"
. ' <label for="text_tablename">' . __('Add privileges on the following table') . ':</label>' . "\n";
if ($res = @PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote(PMA_unescape_mysql_wildcards($dbname)) . ';', null, PMA_DBI_QUERY_STORE)) {
if ($res = @PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote(PMA_unescapeMysqlWildcards($dbname)) . ';', null, PMA_DBI_QUERY_STORE)) {
$pred_tbl_array = array();
while ($row = PMA_DBI_fetch_row($res)) {
if (! isset($found_rows) || ! in_array($row[0], $found_rows)) {
@ -2520,7 +2520,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
. ' ';
if (! isset($current['Db']) || $current['Db'] == '*') {
$user_form .= __('global');
} elseif ($current['Db'] == PMA_escape_mysql_wildcards($checkprivs)) {
} elseif ($current['Db'] == PMA_escapeMysqlWildcards($checkprivs)) {
$user_form .= __('database-specific');
} else {
$user_form .= __('wildcard'). ': <code>' . htmlspecialchars($current['Db']) . '</code>';

View File

@ -526,7 +526,7 @@ foreach ($rows as $row_id => $vrow) {
$special_chars = '';
$data = $vrow[$field['Field']];
} elseif ($field['True_Type'] == 'bit') {
$special_chars = PMA_printable_bit_value(
$special_chars = PMA_printableBitValue(
$vrow[$field['Field']], $extracted_columnspec['spec_in_brackets']
);
} elseif (in_array($field['True_Type'], $gis_data_types)) {
@ -540,7 +540,7 @@ foreach ($rows as $row_id => $vrow) {
$vrow[$field['Field']] = bin2hex($vrow[$field['Field']]);
$field['display_binary_as_hex'] = true;
} else {
$vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);
$vrow[$field['Field']] = PMA_replaceBinaryContents($vrow[$field['Field']]);
}
} // end if
$special_chars = htmlspecialchars($vrow[$field['Field']]);
@ -576,7 +576,7 @@ foreach ($rows as $row_id => $vrow) {
$data = $field['Default'];
}
if ($field['True_Type'] == 'bit') {
$special_chars = PMA_convert_bit_default_value($field['Default']);
$special_chars = PMA_convertBitDefaultValue($field['Default']);
} else {
$special_chars = htmlspecialchars($field['Default']);
}

View File

@ -122,7 +122,7 @@ $cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['relwork']) {
$existrel = PMA_getForeigners($db, $table, '', 'internal');
}
if (PMA_foreignkey_supported($tbl_storage_engine)) {
if (PMA_isForeignKeySupported($tbl_storage_engine)) {
$existrel_foreign = PMA_getForeigners($db, $table, '', 'foreign');
}
if ($cfgRelation['displaywork']) {
@ -326,7 +326,7 @@ if ($cfgRelation['displaywork'] && isset($display_field)) {
if (isset($destination) && $cfgRelation['relwork']) {
$existrel = PMA_getForeigners($db, $table, '', 'internal');
}
if (isset($destination_foreign) && PMA_foreignkey_supported($tbl_storage_engine)) {
if (isset($destination_foreign) && PMA_isForeignKeySupported($tbl_storage_engine)) {
$existrel_foreign = PMA_getForeigners($db, $table, '', 'foreign');
}
@ -346,13 +346,13 @@ echo PMA_generate_common_hidden_inputs($db, $table);
// relations
if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_storage_engine)) {
if ($cfgRelation['relwork'] || PMA_isForeignKeySupported($tbl_storage_engine)) {
// To choose relations we first need all tables names in current db
// and if the main table supports foreign keys
// we use SHOW TABLE STATUS because we need to find other tables of the
// same engine.
if (PMA_foreignkey_supported($tbl_storage_engine)) {
if (PMA_isForeignKeySupported($tbl_storage_engine)) {
$tab_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
// [0] of the row is the name
// [1] is the type
@ -373,7 +373,7 @@ if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_storage_engine)) {
// if foreign keys are supported, collect all keys from other
// tables of the same engine
if (PMA_foreignkey_supported($tbl_storage_engine)
if (PMA_isForeignKeySupported($tbl_storage_engine)
&& isset($curr_table[1])
&& strtoupper($curr_table[1]) == $tbl_storage_engine
) {
@ -402,12 +402,12 @@ if (count($columns) > 0) {
<?php
if ($cfgRelation['relwork']) {
echo '<th>' . __('Internal relation');
if (PMA_foreignkey_supported($tbl_storage_engine)) {
if (PMA_isForeignKeySupported($tbl_storage_engine)) {
echo PMA_showHint(__('An internal relation is not necessary when a corresponding FOREIGN KEY relation exists.'));
}
echo '</th>';
}
if (PMA_foreignkey_supported($tbl_storage_engine)) {
if (PMA_isForeignKeySupported($tbl_storage_engine)) {
// this does not have to be translated, it's part of the MySQL syntax
echo '<th colspan="2">' . __('Foreign key constraint') . ' (' . $tbl_storage_engine . ')';
echo '</th>';
@ -466,7 +466,7 @@ if (count($columns) > 0) {
<?php
} // end if (internal relations)
if (PMA_foreignkey_supported($tbl_storage_engine)) {
if (PMA_isForeignKeySupported($tbl_storage_engine)) {
echo '<td>';
if (!empty($save_row[$i]['Key'])) {
?>

View File

@ -89,7 +89,7 @@ $url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, 'topmenu2');
echo PMA_generateHtmlTabs(PMA_tbl_getSubTabs(), $url_params, 'topmenu2');
?>

View File

@ -346,7 +346,7 @@ foreach ($fields as $row) {
if (isset($row['Default'])) {
if ($extracted_columnspec['type'] == 'bit') {
// here, $row['Default'] contains something like b'010'
echo PMA_convert_bit_default_value($row['Default']);
echo PMA_convertBitDefaultValue($row['Default']);
} else {
echo $row['Default'];
}
@ -659,7 +659,7 @@ if (! $tbl_is_view && ! $db_is_information_schema) {
// if internal relations are available, or foreign keys are supported
// ($tbl_storage_engine comes from libraries/tbl_info.inc.php)
if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_storage_engine)) {
if ($cfgRelation['relwork'] || PMA_isForeignKeySupported($tbl_storage_engine)) {
?>
<a href="tbl_relation.php?<?php echo $url_query; ?>"><?php
echo PMA_getIcon('b_relations.png', __('Relation view'), true);

View File

@ -330,7 +330,7 @@ if (isset($_REQUEST['snapshot'])) {
$extracted_columnspec = PMA_extractColumnSpec($field['Type']);
if ($extracted_columnspec['type'] == 'bit') {
// here, $field['Default'] contains something like b'010'
echo PMA_convert_bit_default_value($field['Default']);
echo PMA_convertBitDefaultValue($field['Default']);
} else {
echo htmlspecialchars($field['Default']);
}

View File

@ -3,7 +3,6 @@
/**
* Test for PMA_Config class
*
*
* @package PhpMyAdmin-test
* @group current
*/
@ -272,8 +271,10 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @covers PMA_Config::get
* @covers PMA_Config::set
*
* @return void
*/
public function testGetAndSet()
@ -308,6 +309,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @depends testCheckPmaAbsoluteUriEmpty
*/
public function testCheckPmaAbsoluteUriNormal()
@ -323,6 +325,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @depends testCheckPmaAbsoluteUriNormal
*/
public function testCheckPmaAbsoluteUriScheme()
@ -339,6 +342,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @depends testCheckPmaAbsoluteUriScheme
*/
public function testCheckPmaAbsoluteUriUser()
@ -398,6 +402,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @depends testDetectHttps
*/
public function testCheckCookiePath()
@ -408,6 +413,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @depends testCheckSystem
* @depends testCheckWebServer
* @depends testLoadDefaults
@ -438,6 +444,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testSave().
*/
public function testSave()
@ -449,6 +456,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testGetFontsizeForm().
*/
public function testGetFontsizeForm()
@ -460,6 +468,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testRemoveCookie().
*/
public function testRemoveCookie()
@ -469,7 +478,8 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
'This test has not been implemented yet.'
);
}
/**
/**
*
* @todo Implement testCheckFontsize().
*/
public function testCheckFontsize()
@ -481,6 +491,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testCheckUpload().
*/
public function testCheckUpload()
@ -492,6 +503,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testCheckUploadSize().
*/
public function testCheckUploadSize()
@ -503,6 +515,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testCheckIsHttps().
*/
public function testCheckIsHttps()
@ -514,6 +527,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testGetCookiePath().
*/
public function testGetCookiePath()
@ -525,6 +539,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo finish implementing test + dependencies
*/
public function testLoad()
@ -535,6 +550,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testLoadUserPreferences().
*/
public function testLoadUserPreferences()
@ -545,6 +561,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testSetUserValue().
*/
public function testSetUserValue()
@ -555,6 +572,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testGetUserValue().
*/
public function testGetUserValue()
@ -563,6 +581,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testGetThemeUniqueValue().
*/
public function testGetThemeUniqueValue()
@ -574,6 +593,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testCheckPermissions().
*/
public function testCheckPermissions()
@ -586,6 +606,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
/**
*
* @todo Implement testSetCookie().
*/
public function testSetCookie()
@ -602,6 +623,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
*
* @dataProvider sslUris
*/
public function testSSLUri($original, $expected)

View File

@ -5,7 +5,6 @@ require_once 'libraries/Theme.class.php';
/**
* Test class for PMA_Theme.
* Generated by PHPUnit on 2011-07-18 at 03:19:13.
*/
class PMA_ThemeTest extends PHPUnit_Framework_TestCase
{
@ -40,7 +39,10 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
public function testCheckImgPathIncorrect()
{
$this->object->setPath('./test/classes/_data/incorrect_theme');
$this->assertFalse($this->object->loadInfo(), 'Theme name is not properly set');
$this->assertFalse(
$this->object->loadInfo(),
'Theme name is not properly set'
);
}
public function testCheckImgPathFull()
@ -54,12 +56,16 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
public function testLoadInfo()
{
$this->object->setPath('./themes/original');
$infofile = $this->object->getPath().'/info.inc.php';
$this->assertTrue($this->object->loadInfo());
$this->assertEquals(filemtime($this->object->getPath().'/info.inc.php'), $this->object->mtime_info);
$this->assertEquals(
filemtime($infofile),
$this->object->mtime_info
);
$this->object->setPath('./themes/original');
$this->object->mtime_info = filemtime($this->object->getPath().'/info.inc.php');
$this->object->mtime_info = filemtime($infofile);
$this->assertTrue($this->object->loadInfo());
$this->assertEquals('Original', $this->object->getName());
}
@ -76,6 +82,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @expectedException PHPUnit_Framework_Error
*/
public function testCheckImgPathBad()
@ -101,6 +108,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @expectedException PHPUnit_Framework_Error
*/
public function testCheckImgPathGlobalsWrongPath()
@ -115,6 +123,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @covers PMA_Theme::setPath
* @covers PMA_Theme::getPath
*/
@ -132,11 +141,16 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @depends testLoadInfo
*/
public function testGetSetCheckVersion()
{
$this->assertEquals('0.0.0.0', $this->object->getVersion(), 'Version 0.0.0.0 by default');
$this->assertEquals(
'0.0.0.0',
$this->object->getVersion(),
'Version 0.0.0.0 by default'
);
$this->object->setVersion("1.2.3.4");
$this->assertEquals('1.2.3.4', $this->object->getVersion());
@ -146,6 +160,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @covers PMA_Theme::getName
* @covers PMA_Theme::setName
*/
@ -158,6 +173,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @covers PMA_Theme::getId
* @covers PMA_Theme::setId
*/
@ -170,12 +186,16 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @covers PMA_Theme::getImgPath
* @covers PMA_Theme::setImgPath
*/
public function testGetSetImgPath()
{
$this->assertEmpty($this->object->getImgPath(), 'ImgPath is empty by default');
$this->assertEmpty(
$this->object->getImgPath(),
'ImgPath is empty by default'
);
$this->object->setImgPath('/new/path');
$this->assertEquals('/new/path', $this->object->getImgPath());
@ -194,6 +214,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* @todo Implement testPrintPreview().
*/
public function testPrintPreview()

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test for PMA_generate_html_dropdown_test from common.lib.php
* Test for PMA_getDropdown from common.lib.php
*
* @package PhpMyAdmin-test
* @group common.lib-tests
@ -12,9 +12,9 @@
*/
require_once 'libraries/common.lib.php';
class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase
class PMA_GetDropdownTest extends PHPUnit_Framework_TestCase
{
function testGenerateHtmlDropdownEmpty()
function testGetDropdownEmpty()
{
$name = "test_dropdown_name";
$choices = array();
@ -26,7 +26,7 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase
$this->assertEquals($result, PMA_getDropdown($name, $choices, $active_choice, $id));
}
function testGenerateHtmlDropdown()
function testGetDropdown()
{
$name = "&test_dropdown_name";
$choices = array("value_1" => "label_1", "value&_2\"" => "label_2");
@ -46,7 +46,7 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase
$this->assertEquals($result, PMA_getDropdown($name, $choices, $active_choice, $id));
}
function testGenerateHtmlDropdownWithActive()
function testGetDropdownWithActive()
{
$name = "&test_dropdown_name";
$choices = array("value_1" => "label_1", "value&_2\"" => "label_2");

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test for PMA_contains_nonprintable_ascii from common.lib
* Test for PMA_containsNonPrintableAscii from common.lib
*
* @package PhpMyAdmin-test
* @group common.lib-tests
@ -12,7 +12,7 @@
*/
require_once 'libraries/common.lib.php';
class PMA_contains_nonprintable_ascii extends PHPUnit_Framework_TestCase
class PMA_ContainsNonPrintableAsciiTest extends PHPUnit_Framework_TestCase
{
function dataProvider()
@ -31,9 +31,9 @@ class PMA_contains_nonprintable_ascii extends PHPUnit_Framework_TestCase
*/
function testContainsNonPrintableAscii($str, $res)
{
$this->assertEquals($res, PMA_contains_nonprintable_ascii($str));
$this->assertEquals($res, PMA_containsNonPrintableAscii($str));
}
}
// PMA_contains_nonprintable_ascii
// PMA_containsNonPrintableAscii

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test for PMA_convert_bit_default_value from common.lib
* Test for PMA_convertBitDefaultValue from common.lib
*
* @package PhpMyAdmin-test
* @group common.lib-tests
@ -12,7 +12,7 @@
*/
require_once 'libraries/common.lib.php';
class PMA_convert_bit_default_value_test extends PHPUnit_Framework_TestCase
class PMA_ConvertBitDefaultValueTest extends PHPUnit_Framework_TestCase
{
function dataProvider()
@ -29,7 +29,7 @@ class PMA_convert_bit_default_value_test extends PHPUnit_Framework_TestCase
*/
function testConvert_bit_default_value_test($bit, $val)
{
$this->assertEquals($val, PMA_convert_bit_default_value($bit));
$this->assertEquals($val, PMA_convertBitDefaultValue($bit));
}
}

View File

@ -12,7 +12,7 @@
*/
require_once 'libraries/common.lib.php';
class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
class PMA_EscapeMySqlWildcardsTest extends PHPUnit_Framework_TestCase
{
public function escapeDataProvider()
@ -30,23 +30,23 @@ class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
}
/**
* PMA_escape_mysql_wildcards tests
* PMA_escapeMysqlWildcards tests
* @dataProvider escapeDataProvider
*/
public function testEscape($a, $b)
{
$this->assertEquals($a, PMA_escape_mysql_wildcards($b));
$this->assertEquals($a, PMA_escapeMysqlWildcards($b));
}
/**
* PMA_unescape_mysql_wildcards tests
* PMA_unescapeMysqlWildcards tests
* @dataProvider escapeDataProvider
*/
public function testUnEscape($a, $b)
{
$this->assertEquals($b, PMA_unescape_mysql_wildcards($a));
$this->assertEquals($b, PMA_unescapeMysqlWildcards($a));
}
}
?>

View File

@ -12,7 +12,7 @@
*/
require_once 'libraries/common.lib.php';
class PMA_foreignKeySupported_test extends PHPUnit_Framework_TestCase
class PMA_IsForeignKeySupportedTest extends PHPUnit_Framework_TestCase
{
/**
* data provider for foreign key supported test
@ -34,7 +34,7 @@ class PMA_foreignKeySupported_test extends PHPUnit_Framework_TestCase
*/
public function testForeignkeySupported($a, $e)
{
$this->assertEquals($e, PMA_foreignkey_supported($a));
$this->assertEquals($e, PMA_isForeignKeySupported($a));
}
}
?>

View File

@ -12,7 +12,7 @@
*/
require_once 'libraries/common.lib.php';
class PMA_display_html_checkbox_test extends PHPUnit_Framework_TestCase
class PMA_GetCheckboxTest extends PHPUnit_Framework_TestCase
{
function testGetCheckbox()
{

View File

@ -12,9 +12,9 @@
*/
require_once 'libraries/common.lib.php';
class PMA_generate_slider_effect_test extends PHPUnit_Framework_TestCase
class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase
{
function testGenerateSliderEffectTest()
function testGetDivForSliderEffectTest()
{
global $cfg;
$cfg['InitialSlidersState'] = 'undefined';
@ -26,7 +26,7 @@ class PMA_generate_slider_effect_test extends PHPUnit_Framework_TestCase
PMA_getDivForSliderEffect($id, $message);
}
function testGenerateSliderEffectTestClosed()
function testGetDivForSliderEffectTestClosed()
{
global $cfg;
$cfg['InitialSlidersState'] = 'closed';
@ -38,7 +38,7 @@ class PMA_generate_slider_effect_test extends PHPUnit_Framework_TestCase
PMA_getDivForSliderEffect($id, $message);
}
function testGenerateSliderEffectTestDisabled()
function testGetDivForSliderEffectTestDisabled()
{
global $cfg;
$cfg['InitialSlidersState'] = 'disabled';

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test for PMA_display_html_radio from common.lib.php
* Test for PMA_getRadioFields from common.lib.php
*
* @package PhpMyAdmin-test
* @group common.lib-tests
@ -12,18 +12,18 @@
*/
require_once 'libraries/common.lib.php';
class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
{
function testDisplayHtmlRadioEmpty()
function testGetRadioFieldsEmpty()
{
$name = "test_display_radio";
$choices = array();
$this->expectOutputString("");
PMA_display_html_radio($name, $choices);
PMA_displayHtmlRadio($name, $choices);
}
function testDisplayHtmlRadio()
function testGetRadioFields()
{
$name = "test_display_radio";
$choices = array('value_1'=>'choice_1', 'value_2'=>'choice_2');
@ -39,10 +39,10 @@ class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name, $choices);
PMA_displayHtmlRadio($name, $choices);
}
function testDisplayHtmlRadioWithChecked()
function testGetRadioFieldsWithChecked()
{
$name = "test_display_radio";
$choices = array('value_1'=>'choice_1', 'value_2'=>'choice_2');
@ -62,10 +62,10 @@ class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name, $choices, $checked_choice);
PMA_displayHtmlRadio($name, $choices, $checked_choice);
}
function testDisplayHtmlRadioWithCheckedWithClass()
function testGetRadioFieldsWithCheckedWithClass()
{
$name = "test_display_radio";
$choices = array('value_1'=>'choice_1', 'value_2'=>'choice_2');
@ -88,10 +88,10 @@ class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name, $choices, $checked_choice, true, false, $class);
PMA_displayHtmlRadio($name, $choices, $checked_choice, true, false, $class);
}
function testDisplayHtmlRadioWithoutBR()
function testGetRadioFieldsWithoutBR()
{
$name = "test_display_radio";
$choices = array('value_1'=>'choice_1', 'value&_&lt;2&gt;'=>'choice_2');
@ -110,10 +110,10 @@ class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name, $choices, $checked_choice, false);
PMA_displayHtmlRadio($name, $choices, $checked_choice, false);
}
function testDisplayHtmlRadioEscapeLabelEscapeLabel()
function testGetRadioFieldsEscapeLabelEscapeLabel()
{
$name = "test_display_radio";
$choices = array('value_1'=>'choice_1', 'value_&2'=>'choice&_&lt;2&gt;');
@ -133,10 +133,10 @@ class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name, $choices, $checked_choice, true, true);
PMA_displayHtmlRadio($name, $choices, $checked_choice, true, true);
}
function testDisplayHtmlRadioEscapeLabelNotEscapeLabel()
function testGetRadioFieldsEscapeLabelNotEscapeLabel()
{
$name = "test_display_radio";
$choices = array('value_1'=>'choice_1', 'value_&2'=>'choice&_&lt;2&gt;');
@ -156,10 +156,10 @@ class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name, $choices, $checked_choice, true, false);
PMA_displayHtmlRadio($name, $choices, $checked_choice, true, false);
}
function testDisplayHtmlRadioEscapeLabelEscapeLabelWithClass()
function testGetRadioFieldsEscapeLabelEscapeLabelWithClass()
{
$name = "test_display_radio";
$choices = array('value_1'=>'choice_1', 'value_&2'=>'choice&_&lt;2&gt;');
@ -182,6 +182,6 @@ class PMA_display_html_radio_test extends PHPUnit_Framework_TestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name, $choices, $checked_choice, true, true, $class);
PMA_displayHtmlRadio($name, $choices, $checked_choice, true, true, $class);
}
}

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test printableBitValue function
* Test PMA_printableBitValue function
*
* @package PhpMyAdmin-test
* @group common.lib-tests
@ -12,7 +12,7 @@
*/
require_once 'libraries/common.lib.php';
class PMA_printableBitValue_test extends PHPUnit_Framework_TestCase
class PMA_PrintableBitValueTest extends PHPUnit_Framework_TestCase
{
/**
@ -35,7 +35,7 @@ class PMA_printableBitValue_test extends PHPUnit_Framework_TestCase
public function testPrintableBitValue($a, $b, $e)
{
$this->assertEquals($e, PMA_printable_bit_value($a, $b));
$this->assertEquals($e, PMA_printableBitValue($a, $b));
}
}
?>

View File

@ -107,7 +107,7 @@ class PMA_stringOperations_test extends PHPUnit_Framework_TestCase
public function testReplaceBinaryContents($a, $e)
{
$this->assertEquals($e, PMA_replace_binary_contents($a));
$this->assertEquals($e, PMA_replaceBinaryContents($a));
}
/**

View File

@ -196,7 +196,6 @@ class PMA_headerLocation_test extends PHPUnit_Framework_TestCase
if ($this->runkitExt && $this->apdExt) {
runkit_constant_redefine('PMA_IS_IIS', true);
runkit_constant_add('PMA_COMING_FROM_COOKIE_LOGIN', true);
$testUri = 'http://testurl.com/test.php';
$separator = PMA_get_arg_separator();
@ -205,9 +204,6 @@ class PMA_headerLocation_test extends PHPUnit_Framework_TestCase
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
// cleaning constant
runkit_constant_remove('PMA_COMING_FROM_COOKIE_LOGIN');
$this->assertEquals($header, $GLOBALS['header']);
} else {

View File

@ -143,7 +143,7 @@ $tabs['import']['link'] = 'server_import.php';
$tabs['import']['text'] = 'active';
$tabs['import']['class'] = 'active';
echo PMA_generate_html_tabs($tabs, array());
echo PMA_generateHtmlTabs($tabs, array());
unset($tabs);
if (@file_exists($pmaThemeImage . 'logo_right.png')) {