Remove unused locale variables.
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
This commit is contained in:
parent
516352237b
commit
a68ea85d4d
@ -61,6 +61,7 @@ class Relation_Stats_Eps extends RealtionStats
|
||||
{
|
||||
global $eps;
|
||||
|
||||
/* Commented because $color unused.
|
||||
if ($showColor) {
|
||||
$listOfColors = array(
|
||||
'red',
|
||||
@ -75,7 +76,7 @@ class Relation_Stats_Eps extends RealtionStats
|
||||
$color = $listOfColors[0];
|
||||
} else {
|
||||
$color = 'black';
|
||||
}
|
||||
}*/
|
||||
// draw a line like -- to foreign field
|
||||
$eps->line(
|
||||
$this->xSrc,
|
||||
|
||||
@ -602,8 +602,6 @@ function PMA_removeRelation($T1, $F1, $T2, $F2)
|
||||
$tables = $GLOBALS['dbi']->getTablesFull($DB2, $T2);
|
||||
$type_T2 = /*overload*/mb_strtoupper($tables[$T2]['ENGINE']);
|
||||
|
||||
$try_to_delete_internal_relation = false;
|
||||
|
||||
if (PMA_Util::isForeignKeySupported($type_T1)
|
||||
&& PMA_Util::isForeignKeySupported($type_T2)
|
||||
&& $type_T1 == $type_T2
|
||||
@ -618,24 +616,15 @@ function PMA_removeRelation($T1, $F1, $T2, $F2)
|
||||
. PMA_Util::backquote($foreigner['constraint']) . ';';
|
||||
if ($GLOBALS['dbi']->query($upd_query)) {
|
||||
return array(true, __('FOREIGN KEY relation has been removed.'));
|
||||
} else {
|
||||
$error = $GLOBALS['dbi']->getError();
|
||||
return array(
|
||||
false,
|
||||
__('Error: FOREIGN KEY relation could not be removed!')
|
||||
. "<br/>" . $error
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// there can be an internal relation even if InnoDB
|
||||
$try_to_delete_internal_relation = true;
|
||||
}
|
||||
} else {
|
||||
$try_to_delete_internal_relation = true;
|
||||
}
|
||||
|
||||
if (!$try_to_delete_internal_relation) {
|
||||
return;
|
||||
$error = $GLOBALS['dbi']->getError();
|
||||
return array(
|
||||
false,
|
||||
__('Error: FOREIGN KEY relation could not be removed!')
|
||||
. "<br/>" . $error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// internal relations
|
||||
|
||||
@ -22,7 +22,7 @@ function PMA_RTE_getFooterLinks($docu, $priv, $name)
|
||||
{
|
||||
global $db, $table, $url_query, $ajax_class;
|
||||
|
||||
$icon = 'b_' . /*overload*/mb_strtolower($name) . '_add.png';
|
||||
$icon = /*overload*/mb_strtolower($name) . '_add.png';
|
||||
$retval = "";
|
||||
$retval .= "<!-- ADD " . $name . " FORM START -->\n";
|
||||
$retval .= "<fieldset class='left'>\n";
|
||||
@ -33,11 +33,11 @@ function PMA_RTE_getFooterLinks($docu, $priv, $name)
|
||||
$retval .= "href='db_" . /*overload*/mb_strtolower($name) . "s.php";
|
||||
$retval .= "?$url_query&add_item=1' ";
|
||||
$retval .= "onclick='$.datepicker.initialized = false;'>";
|
||||
$icon = 'b_' . /*overload*/mb_strtolower($name) . '_add.png';
|
||||
$icon = 'b_' . $icon;
|
||||
$retval .= PMA_Util::getIcon($icon);
|
||||
$retval .= PMA_RTE_getWord('add') . "</a>\n";
|
||||
} else {
|
||||
$icon = 'bd_' . /*overload*/mb_strtolower($name) . '_add.png';
|
||||
$icon = 'bd_' . $icon;
|
||||
$retval .= PMA_Util::getIcon($icon);
|
||||
$retval .= PMA_RTE_getWord('add') . "\n";
|
||||
}
|
||||
|
||||
@ -795,7 +795,7 @@ function PMA_getJsonForQueryAnalyzer()
|
||||
$_REQUEST['query']
|
||||
);
|
||||
|
||||
$result = $GLOBALS['dbi']->tryQuery($query);
|
||||
$GLOBALS['dbi']->tryQuery($query);
|
||||
$return['affectedRows'] = $GLOBALS['cached_affected_rows'];
|
||||
|
||||
$result = $GLOBALS['dbi']->tryQuery('EXPLAIN ' . $query);
|
||||
|
||||
@ -532,7 +532,6 @@ function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i,
|
||||
$html_output .= '</td>';
|
||||
$html_output .= '<td>';
|
||||
$foreign_table = false;
|
||||
$foreign_column = false;
|
||||
|
||||
// foreign database dropdown
|
||||
$foreign_db = (isset($one_key['ref_db_name'])) ? $one_key['ref_db_name'] : $db;
|
||||
|
||||
@ -63,10 +63,6 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase
|
||||
'Comment' => true,
|
||||
);
|
||||
|
||||
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$sql_isView_true = "SELECT TABLE_NAME
|
||||
FROM information_schema.VIEWS
|
||||
WHERE TABLE_SCHEMA = 'PMA'
|
||||
@ -704,9 +700,6 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGenerateAlter()
|
||||
{
|
||||
$table = 'PMA_BookMark';
|
||||
$db = 'PMA';
|
||||
|
||||
//parameter
|
||||
$oldcol = 'name';
|
||||
$newcol = 'new_name';
|
||||
|
||||
@ -203,7 +203,6 @@ class PMA_DBI_Drizzle_Test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$user = "PMA_user";
|
||||
$password = "pma_password";
|
||||
$is_controluser = false;
|
||||
$server = null;
|
||||
|
||||
//$server = null;
|
||||
|
||||
@ -140,7 +140,6 @@ class PMA_DBI_Mysqli_Test extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
|
||||
//test for realMultiQuery
|
||||
$result = $ret;
|
||||
$ret = $this->object->realMultiQuery($link, $query);
|
||||
$this->assertEquals(
|
||||
'mysqli_multi_query',
|
||||
@ -213,7 +212,6 @@ class PMA_DBI_Mysqli_Test extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
|
||||
//test for getClientInfo
|
||||
$link = $ret;
|
||||
$ret = $this->object->getClientInfo();
|
||||
$this->assertEquals(
|
||||
'mysqli_get_client_info',
|
||||
|
||||
@ -356,25 +356,6 @@ class PMA_ExportMediawiki_Test extends PHPUnit_Framework_TestCase
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$columns = array(
|
||||
array(
|
||||
'Null' => 'Yes',
|
||||
'Field' => 'name1',
|
||||
'Key' => 'PRI',
|
||||
'Type' => 'set(abc)enum123',
|
||||
'Default' => '',
|
||||
'Extra' => ''
|
||||
),
|
||||
array(
|
||||
'Null' => 'NO',
|
||||
'Field' => 'fields',
|
||||
'Key' => 'COMP',
|
||||
'Type' => '',
|
||||
'Default' => 'def',
|
||||
'Extra' => 'ext'
|
||||
)
|
||||
);
|
||||
|
||||
$dbi->expects($this->once())
|
||||
->method('getColumnNames')
|
||||
->with('db', 'table')
|
||||
|
||||
@ -222,7 +222,7 @@ class ImportLdi_Test extends PHPUnit_Framework_TestCase
|
||||
public function testDoImportLDISetting()
|
||||
{
|
||||
global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated,
|
||||
$ldi_enclosed, $ldi_escaped, $ldi_new_line, $skip_queries, $ldi_columns;
|
||||
$ldi_enclosed, $ldi_new_line, $skip_queries;
|
||||
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
global $sql_query, $sql_query_disabled;
|
||||
|
||||
@ -268,7 +268,6 @@ class PMA_MultSubmits_Test extends PHPUnit_Framework_TestCase
|
||||
public function testPMAGetQueryStrFromSelected()
|
||||
{
|
||||
$query_type = 'row_delete';
|
||||
$action = 'db_delete_row';
|
||||
$db = "PMA_db";
|
||||
$table = "PMA_table";
|
||||
$selected = array(
|
||||
|
||||
@ -37,27 +37,27 @@ class PMA_MySQL_Charsets_Test extends PHPUnit_Framework_TestCase
|
||||
$this->markTestSkipped(
|
||||
'Cannot redefine constant - missing runkit extension'
|
||||
);
|
||||
}
|
||||
|
||||
$restoreDrizzle = '';
|
||||
|
||||
if (defined('PMA_DRIZZLE')) {
|
||||
$restoreDrizzle = PMA_DRIZZLE;
|
||||
runkit_constant_redefine('PMA_DRIZZLE', $drizzle);
|
||||
} else {
|
||||
$restoreDrizzle = '';
|
||||
$restoreDrizzle = 'PMA_TEST_CONSTANT_REMOVE';
|
||||
define('PMA_DRIZZLE', $drizzle);
|
||||
}
|
||||
|
||||
if (defined('PMA_DRIZZLE')) {
|
||||
$restoreDrizzle = PMA_DRIZZLE;
|
||||
runkit_constant_redefine('PMA_DRIZZLE', $drizzle);
|
||||
} else {
|
||||
$restoreDrizzle = 'PMA_TEST_CONSTANT_REMOVE';
|
||||
define('PMA_DRIZZLE', $drizzle);
|
||||
}
|
||||
$this->assertEquals(
|
||||
$expected,
|
||||
PMA_generateCharsetQueryPart($collation)
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
$expected,
|
||||
PMA_generateCharsetQueryPart($collation)
|
||||
);
|
||||
|
||||
if ($restoreDrizzle === 'PMA_TEST_CONSTANT_REMOVE') {
|
||||
runkit_constant_remove('PMA_DRIZZLE');
|
||||
} else {
|
||||
runkit_constant_redefine('PMA_DRIZZLE', $restoreDrizzle);
|
||||
}
|
||||
if ($restoreDrizzle === 'PMA_TEST_CONSTANT_REMOVE') {
|
||||
runkit_constant_remove('PMA_DRIZZLE');
|
||||
} else {
|
||||
runkit_constant_redefine('PMA_DRIZZLE', $restoreDrizzle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -109,10 +109,8 @@ class PMA_ServerReplication_Test extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testPMAGetHtmlForMasterReplication()
|
||||
{
|
||||
global $master_variables;
|
||||
global $master_variables_alerts;
|
||||
global $master_variables_oks;
|
||||
global $server_master_replication;
|
||||
global $strReplicationStatus_master;
|
||||
|
||||
$master_variables_alerts = null;
|
||||
|
||||
@ -189,8 +189,6 @@ class PMA_ServerStatusQueries_Test extends PHPUnit_Framework_TestCase
|
||||
//Call the test function
|
||||
$html = PMA_getHtmlForServerStatusQueriesDetails($this->ServerStatusData);
|
||||
|
||||
$used_queries = $this->ServerStatusData->used_queries;
|
||||
|
||||
//validate 1: PMA_getHtmlForServerStatusQueriesDetails
|
||||
$this->assertContains(
|
||||
__('Statements'),
|
||||
|
||||
@ -111,7 +111,6 @@ class PMA_TblIndexTest extends PHPUnit_Framework_TestCase
|
||||
public function testPMAGetNumberOfFieldsForForm()
|
||||
{
|
||||
$index = new PMA_Index();
|
||||
$error = false;
|
||||
|
||||
$add_fields = PMA_getNumberOfFieldsForForm($index);
|
||||
|
||||
|
||||
@ -376,11 +376,11 @@ class PMA_TblPrintViewTest extends PHPUnit_Framework_TestCase
|
||||
$showtable['Index_length']
|
||||
);
|
||||
$this->assertContains(
|
||||
$data_size,
|
||||
$index_size,
|
||||
$html
|
||||
);
|
||||
$this->assertContains(
|
||||
$data_unit,
|
||||
$index_unit,
|
||||
$html
|
||||
);
|
||||
|
||||
|
||||
@ -654,7 +654,6 @@ class PMA_TblTrackingTest extends PHPUnit_Framework_TestCase
|
||||
public function testPMAGetHtmlForDataManipulationStatements()
|
||||
{
|
||||
$_REQUEST['version'] = "10";
|
||||
$url_query = "select * from PMA";
|
||||
$data = array(
|
||||
'tracking'=>'tracking',
|
||||
'dmlog' => array(
|
||||
@ -714,7 +713,6 @@ class PMA_TblTrackingTest extends PHPUnit_Framework_TestCase
|
||||
public function testPMAGetHtmlForDataDefinitionStatements()
|
||||
{
|
||||
$_REQUEST['version'] = "10";
|
||||
$url_query = "select * from PMA";
|
||||
|
||||
$data = array(
|
||||
'tracking'=>'tracking',
|
||||
@ -920,8 +918,6 @@ class PMA_TblTrackingTest extends PHPUnit_Framework_TestCase
|
||||
$filter_users = array("*");
|
||||
$filter_ts_to = 9999999999;
|
||||
$filter_ts_from = 0;
|
||||
$url_params = array();
|
||||
$drop_image_or_text = "text";
|
||||
|
||||
$entries = PMA_getEntries(
|
||||
$data, $filter_ts_from, $filter_ts_to, $filter_users
|
||||
|
||||
@ -449,34 +449,5 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
|
||||
$result
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the tag array to be used with assertTag by parsing
|
||||
* a given HTML element
|
||||
*
|
||||
* @param string $elementHTML HTML for element to be parsed
|
||||
* @param array $arr Additional array elements like content, parent
|
||||
*
|
||||
* @return array Tag array to be used with assertTag
|
||||
*/
|
||||
private function _getTagArray($elementHTML, $arr = array())
|
||||
{
|
||||
|
||||
// get attributes
|
||||
preg_match_all("/\s+(.*?)\=\s*\"(.*?)\"/is", $elementHTML, $matches);
|
||||
foreach ($matches[1] as $key => $val) {
|
||||
$arr['attributes'][trim($val)] = trim($matches[2][$key]);
|
||||
}
|
||||
$matches = array();
|
||||
|
||||
// get tag
|
||||
preg_match("/^\<(.*?)(\s|\>)/i", $elementHTML, $matches);
|
||||
if (isset($matches[1])) {
|
||||
$arr['tag'] = trim($matches[1]);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -48,7 +48,7 @@ class PMA_RTN_GetDataFromRequest_Test extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testgetDataFromRequest($in, $out)
|
||||
{
|
||||
global $cfg, $_REQUEST;
|
||||
global $_REQUEST;
|
||||
|
||||
unset($_REQUEST);
|
||||
foreach ($in as $key => $value) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user