Skip to content

Commit

Permalink
Fixes many coding style "line too long"
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed Oct 17, 2013
1 parent 21812d6 commit 88da7ee
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 129 deletions.
156 changes: 78 additions & 78 deletions libraries/DisplayResults.class.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions libraries/RecentTable.class.php
Expand Up @@ -60,11 +60,11 @@ public function __construct()
. PMA_Util::backquote($GLOBALS['cfg']['Server']['recent']);
}
$server_id = $GLOBALS['server'];
if (! isset($_SESSION['tmp_user_values']['recent_tables'][$server_id])) {
$_SESSION['tmp_user_values']['recent_tables'][$server_id]
if (! isset($_SESSION['tmpval']['recent_tables'][$server_id])) {
$_SESSION['tmpval']['recent_tables'][$server_id]
= isset($this->_pmaTable) ? $this->getFromDb() : array();
}
$this->tables =& $_SESSION['tmp_user_values']['recent_tables'][$server_id];
$this->tables =& $_SESSION['tmpval']['recent_tables'][$server_id];
}

/**
Expand Down
6 changes: 3 additions & 3 deletions libraries/Table.class.php
Expand Up @@ -1522,15 +1522,15 @@ protected function loadUiPrefs()
{
$server_id = $GLOBALS['server'];
// set session variable if it's still undefined
if (! isset($_SESSION['tmp_user_values']['table_uiprefs'][$server_id][$this->db_name][$this->name])) {
if (! isset($_SESSION['tmpval']['table_uiprefs'][$server_id][$this->db_name][$this->name])) {
// check whether we can get from pmadb
$_SESSION['tmp_user_values']['table_uiprefs'][$server_id][$this->db_name][$this->name]
$_SESSION['tmpval']['table_uiprefs'][$server_id][$this->db_name][$this->name]
= (strlen($GLOBALS['cfg']['Server']['pmadb'])
&& strlen($GLOBALS['cfg']['Server']['table_uiprefs']))
? $this->getUiPrefsFromDb()
: array();
}
$this->uiprefs =& $_SESSION['tmp_user_values']['table_uiprefs'][$server_id]
$this->uiprefs =& $_SESSION['tmpval']['table_uiprefs'][$server_id]
[$this->db_name][$this->name];
}

Expand Down
8 changes: 4 additions & 4 deletions libraries/common.inc.php
Expand Up @@ -1032,12 +1032,12 @@
/**
* some resetting has to be done when switching servers
*/
if (isset($_SESSION['tmp_user_values']['previous_server'])
&& $_SESSION['tmp_user_values']['previous_server'] != $GLOBALS['server']
if (isset($_SESSION['tmpval']['previous_server'])
&& $_SESSION['tmpval']['previous_server'] != $GLOBALS['server']
) {
unset($_SESSION['tmp_user_values']['navi_limit_offset']);
unset($_SESSION['tmpval']['navi_limit_offset']);
}
$_SESSION['tmp_user_values']['previous_server'] = $GLOBALS['server'];
$_SESSION['tmpval']['previous_server'] = $GLOBALS['server'];

} // end server connecting

Expand Down
12 changes: 6 additions & 6 deletions libraries/db_info.inc.php
Expand Up @@ -18,16 +18,16 @@
/**
* limits for table list
*/
if (! isset($_SESSION['tmp_user_values']['table_limit_offset'])
|| $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db
if (! isset($_SESSION['tmpval']['table_limit_offset'])
|| $_SESSION['tmpval']['table_limit_offset_db'] != $db
) {
$_SESSION['tmp_user_values']['table_limit_offset'] = 0;
$_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
$_SESSION['tmpval']['table_limit_offset'] = 0;
$_SESSION['tmpval']['table_limit_offset_db'] = $db;
}
if (isset($_REQUEST['pos'])) {
$_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
$_SESSION['tmpval']['table_limit_offset'] = (int) $_REQUEST['pos'];
}
$pos = $_SESSION['tmp_user_values']['table_limit_offset'];
$pos = $_SESSION['tmpval']['table_limit_offset'];

PMA_Util::checkParameters(array('db'));

Expand Down
10 changes: 5 additions & 5 deletions libraries/insert_edit.lib.php
Expand Up @@ -1684,7 +1684,7 @@ function PMA_getSpecialCharsAndBackupFieldForExistingRow(
if ($column['is_binary']
|| ($column['is_blob'] && ! $GLOBALS['cfg']['ProtectBinary'])
) {
if ($_SESSION['tmp_user_values']['display_binary_as_hex']
if ($_SESSION['tmpval']['display_binary_as_hex']
&& $GLOBALS['cfg']['ShowFunctionFields']
) {
$current_row[$column['Field']] = bin2hex(
Expand Down Expand Up @@ -1771,8 +1771,8 @@ function PMA_getSpecialCharsAndBackupFieldForInsertingMode(
// this will select the UNHEX function while inserting
if (($column['is_binary']
|| ($column['is_blob'] && ! $GLOBALS['cfg']['ProtectBinary']))
&& (isset($_SESSION['tmp_user_values']['display_binary_as_hex'])
&& $_SESSION['tmp_user_values']['display_binary_as_hex'])
&& (isset($_SESSION['tmpval']['display_binary_as_hex'])
&& $_SESSION['tmpval']['display_binary_as_hex'])
&& $GLOBALS['cfg']['ShowFunctionFields']
) {
$column['display_binary_as_hex'] = true;
Expand Down Expand Up @@ -2083,7 +2083,7 @@ function PMA_getDisplayValueForForeignTableColumn($where_comparison,
function PMA_getLinkForRelationalDisplayField($map, $relation_field,
$where_comparison, $dispval, $relation_field_value
) {
if ('K' == $_SESSION['tmp_user_values']['relational_display']) {
if ('K' == $_SESSION['tmpval']['relational_display']) {
// user chose "relational key" in the display options, so
// the title contains the display field
$title = (! empty($dispval))
Expand All @@ -2105,7 +2105,7 @@ function PMA_getLinkForRelationalDisplayField($map, $relation_field,
$output = '<a href="sql.php'
. PMA_URL_getCommon($_url_params) . '"' . $title . '>';

if ('D' == $_SESSION['tmp_user_values']['relational_display']) {
if ('D' == $_SESSION['tmpval']['relational_display']) {
// user chose "relational display field" in the
// display options, so show display field in the cell
$output .= (!empty($dispval)) ? htmlspecialchars($dispval) : '';
Expand Down
22 changes: 11 additions & 11 deletions libraries/sql.lib.php
Expand Up @@ -149,15 +149,15 @@ function PMA_getTableHtmlForMultipleQueries(
}

// Do append a "LIMIT" clause?
if (($_SESSION['tmp_user_values']['max_rows'] != 'all')
if (($_SESSION['tmpval']['max_rows'] != 'all')
&& ! ($is_count || $is_export || $is_func || $is_analyse)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& ! isset($analyzed_sql[0]['queryflags']['offset'])
&& empty($analyzed_sql[0]['limit_clause'])
) {
$sql_limit_to_append = ' LIMIT '
. $_SESSION['tmp_user_values']['pos']
. ', ' . $_SESSION['tmp_user_values']['max_rows'] . " ";
. $_SESSION['tmpval']['pos']
. ', ' . $_SESSION['tmpval']['max_rows'] . " ";
$sql_data['valid_sql'][$sql_no] = PMA_getSqlWithLimitClause(
$sql_data['valid_sql'][$sql_no],
$analyzed_sql,
Expand Down Expand Up @@ -831,7 +831,7 @@ function PMA_isAppendLimitClause($analyzed_sql_results)
$select_from = isset(
$analyzed_sql_results['analyzed_sql'][0]['queryflags']['select_from']
);
if (($_SESSION['tmp_user_values']['max_rows'] != 'all')
if (($_SESSION['tmpval']['max_rows'] != 'all')
&& ! ($analyzed_sql_results['is_count']
|| $analyzed_sql_results['is_export']
|| $analyzed_sql_results['is_func']
Expand Down Expand Up @@ -1050,9 +1050,9 @@ function PMA_addBookmark($pmaAbsoluteUri, $goto)
function PMA_findRealEndOfRows($db, $table)
{
$unlim_num_rows = PMA_Table::countRecords($db, $table, true);
$_SESSION['tmp_user_values']['pos'] = @((ceil(
$unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']
) - 1) * $_SESSION['tmp_user_values']['max_rows']);
$_SESSION['tmpval']['pos'] = @((ceil(
$unlim_num_rows / $_SESSION['tmpval']['max_rows']
) - 1) * $_SESSION['tmpval']['max_rows']);

return $unlim_num_rows;
}
Expand All @@ -1069,7 +1069,7 @@ function PMA_findRealEndOfRows($db, $table)
function PMA_getRelationalValues($db, $table, $display_field)
{
$column = $_REQUEST['column'];
if ($_SESSION['tmp_user_values']['relational_display'] == 'D'
if ($_SESSION['tmpval']['relational_display'] == 'D'
&& isset($display_field)
&& strlen($display_field)
&& isset($_REQUEST['relation_key_or_display_column'])
Expand Down Expand Up @@ -1124,8 +1124,8 @@ function PMA_getEnumOrSetValues($db, $table, $columnType)
*/
function PMA_appendLimitClause($full_sql_query, $analyzed_sql, $display_query)
{
$sql_limit_to_append = ' LIMIT ' . $_SESSION['tmp_user_values']['pos']
. ', ' . $_SESSION['tmp_user_values']['max_rows'] . " ";
$sql_limit_to_append = ' LIMIT ' . $_SESSION['tmpval']['pos']
. ', ' . $_SESSION['tmpval']['max_rows'] . " ";
$full_sql_query = PMA_getSqlWithLimitClause(
$full_sql_query,
$analyzed_sql,
Expand Down Expand Up @@ -1388,7 +1388,7 @@ function PMA_countQueryResults(
if (!PMA_isAppendLimitClause($analyzed_sql_results)) {
// if we did not append a limit, set this to get a correct
// "Showing rows..." message
// $_SESSION['tmp_user_values']['max_rows'] = 'all';
// $_SESSION['tmpval']['max_rows'] = 'all';
$unlim_num_rows = $num_rows;
} elseif ($is_select) {
// c o u n t q u e r y
Expand Down
6 changes: 3 additions & 3 deletions libraries/tbl_chart.lib.php
Expand Up @@ -205,12 +205,12 @@ function PMA_getHtmlForStartAndNumberOfRowsOptions($sql_query)
. '<div>'
. '<label for="pos">' . __('Start row:') . '</label>'
. '<input type="text" name="pos" size="3" value="'
. $_SESSION['tmp_user_values']['pos'] . '" />'
. $_SESSION['tmpval']['pos'] . '" />'
. '<label for="session_max_rows">'
. __('Number of rows:') . '</label>'
. '<input type="text" name="session_max_rows" size="3" value="'
. (($_SESSION['tmp_user_values']['max_rows'] != 'all')
? $_SESSION['tmp_user_values']['max_rows']
. (($_SESSION['tmpval']['max_rows'] != 'all')
? $_SESSION['tmpval']['max_rows']
: $GLOBALS['cfg']['MaxRows'])
. '" />'
. '<input type="submit" name="submit" class="Go" value="' . __('Go')
Expand Down
18 changes: 9 additions & 9 deletions test/classes/PMA_DisplayResults_test.php
Expand Up @@ -407,14 +407,14 @@ public function providerForTestGetTableNavigationButton()
public function testGetTableNavigation(
$pos_next, $pos_prev, $id_for_direction_dropdown, $is_innodb, $output
) {
$_SESSION['tmp_user_values']['max_rows'] = '20';
$_SESSION['tmp_user_values']['pos'] = true;
$_SESSION['tmpval']['max_rows'] = '20';
$_SESSION['tmpval']['pos'] = true;
$GLOBALS['num_rows'] = '20';
$GLOBALS['unlim_num_rows'] = '50';
$GLOBALS['cfg']['ShowAll'] = true;
$GLOBALS['cfg']['ShowDisplayDirection'] = true;
$_SESSION['tmp_user_values']['repeat_cells'] = '1';
$_SESSION['tmp_user_values']['disp_direction'] = '1';
$_SESSION['tmpval']['repeat_cells'] = '1';
$_SESSION['tmpval']['disp_direction'] = '1';

/**
* FIXME Counting words of a generated large HTML is not a good way
Expand Down Expand Up @@ -496,7 +496,7 @@ public function testGetClassesForColumn(
) {
$GLOBALS['cfg']['BrowsePointerEnable'] = true;
$GLOBALS['cfg']['BrowseMarkerEnable'] = true;
$_SESSION['tmp_user_values']['disp_direction']
$_SESSION['tmpval']['disp_direction']
= PMA_DisplayResults::DISP_DIR_VERTICAL;

$this->assertEquals(
Expand Down Expand Up @@ -675,7 +675,7 @@ public function testGetCheckBoxesForMultipleRowOperations(

$this->object->__set('vertical_display', $vertical_display);

$_SESSION['tmp_user_values']['repeat_cells'] = 0;
$_SESSION['tmpval']['repeat_cells'] = 0;
$this->assertEquals(
$output,
$this->_callPrivateFunction(
Expand All @@ -692,7 +692,7 @@ public function testGetCheckBoxesForMultipleRowOperations(
*/
public function testGetOffsetsCase1()
{
$_SESSION['tmp_user_values']['max_rows'] = PMA_DisplayResults::ALL_ROWS;
$_SESSION['tmpval']['max_rows'] = PMA_DisplayResults::ALL_ROWS;
$this->assertEquals(
array(0, 0),
$this->_callPrivateFunction('_getOffsets', array())
Expand All @@ -706,8 +706,8 @@ public function testGetOffsetsCase1()
*/
public function testGetOffsetsCase2()
{
$_SESSION['tmp_user_values']['max_rows'] = 5;
$_SESSION['tmp_user_values']['pos'] = 4;
$_SESSION['tmpval']['max_rows'] = 5;
$_SESSION['tmpval']['pos'] = 4;
$this->assertEquals(
array(9, 0),
$this->_callPrivateFunction('_getOffsets', array())
Expand Down
10 changes: 5 additions & 5 deletions test/libraries/PMA_insert_edit_test.php
Expand Up @@ -1722,7 +1722,7 @@ public function testGetSpecialCharsAndBackupFieldForExistingRow()
$current_row['f'] = "11001";
$extracted_columnspec['spec_in_brackets'] = 20;
$column['True_Type'] = 'char';
$_SESSION['tmp_user_values']['display_binary_as_hex'] = true;
$_SESSION['tmpval']['display_binary_as_hex'] = true;
$GLOBALS['cfg']['ShowFunctionFields'] = true;

$result = PMA_getSpecialCharsAndBackupFieldForExistingRow(
Expand All @@ -1742,7 +1742,7 @@ public function testGetSpecialCharsAndBackupFieldForExistingRow()

// Case 5 (false display_binary_as_hex)
$current_row['f'] = "11001\x00";
$_SESSION['tmp_user_values']['display_binary_as_hex'] = false;
$_SESSION['tmpval']['display_binary_as_hex'] = false;

$result = PMA_getSpecialCharsAndBackupFieldForExistingRow(
$current_row, $column, $extracted_columnspec, false, array('int'), 'a'
Expand Down Expand Up @@ -1771,7 +1771,7 @@ public function testGetSpecialCharsAndBackupFieldForInsertingMode()
$column['Default'] = b'101';
$column['is_binary'] = true;
$GLOBALS['cfg']['ProtectBinary'] = false;
$_SESSION['tmp_user_values']['display_binary_as_hex'] = true;
$_SESSION['tmpval']['display_binary_as_hex'] = true;
$GLOBALS['cfg']['ShowFunctionFields'] = true;

$result = PMA_getSpecialCharsAndBackupFieldForInsertingMode($column, false);
Expand Down Expand Up @@ -2273,7 +2273,7 @@ public function testGetDisplayValueForForeignTableColumn()
public function testGetLinkForRelationalDisplayField()
{
$GLOBALS['cfg']['ServerDefault'] = 1;
$_SESSION['tmp_user_values']['relational_display'] = 'K';
$_SESSION['tmpval']['relational_display'] = 'K';
$map['f']['foreign_db'] = 'information_schema';
$map['f']['foreign_table'] = 'TABLES';
$map['f']['foreign_field'] = 'f';
Expand All @@ -2287,7 +2287,7 @@ public function testGetLinkForRelationalDisplayField()
$result
);

$_SESSION['tmp_user_values']['relational_display'] = 'D';
$_SESSION['tmpval']['relational_display'] = 'D';
$result = PMA_getLinkForRelationalDisplayField($map, 'f', "=1", "a>", "b<");

$this->assertEquals(
Expand Down
4 changes: 2 additions & 2 deletions test/libraries/PMA_tbl_chart_test.php
Expand Up @@ -184,8 +184,8 @@ public function testPMAGetHtmlForChartXAxisOptions()
public function testPMAGetHtmlForTableChartDisplay()
{
$_SESSION[' PMA_token '] = "PMA_token";
$_SESSION['tmp_user_values']['pos'] = "pos";
$_SESSION['tmp_user_values']['max_rows'] = "all";
$_SESSION['tmpval']['pos'] = "pos";
$_SESSION['tmpval']['max_rows'] = "all";
$GLOBALS['cfg']['MaxRows'] = 10;

$url_query = "url_query";
Expand Down

0 comments on commit 88da7ee

Please sign in to comment.