From c0082f87d8be08551dcc37fb1ce9ad0d8a489872 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 17:22:27 +0200 Subject: [PATCH 01/12] Fix coding style --- test/libraries/PMA_zip_extension_test.php | 57 +++++++++++++++++------ 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/test/libraries/PMA_zip_extension_test.php b/test/libraries/PMA_zip_extension_test.php index 358c5bb57c..272909675f 100644 --- a/test/libraries/PMA_zip_extension_test.php +++ b/test/libraries/PMA_zip_extension_test.php @@ -12,16 +12,20 @@ require_once 'libraries/zip_extension.lib.php'; require_once 'libraries/php-gettext/gettext.inc'; -class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { - +class PMA_zip_extension_test extends PHPUnit_Framework_TestCase +{ /** + * Test zip file content + * * @param string $file zip file * @param string $specific_entry regular expression to match a file - * @param $output + * @param mixed $output expected output * * @dataProvider providerForTestGetZipContents + * @return void */ - public function testGetZipContents($file, $specific_entry, $output){ + public function testGetZipContents($file, $specific_entry, $output) + { $this->assertEquals( PMA_getZipContents($file, $specific_entry), $output @@ -30,8 +34,11 @@ class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { /** * Provider for testGetZipContents + * + * @return array */ - public function providerForTestGetZipContents(){ + public function providerForTestGetZipContents() + { return array( array( './test/test_data/test.zip', @@ -53,13 +60,17 @@ class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { } /** + * Test Find file in Zip Archive + * * @param string $file_regexp regular expression for the file name to match * @param string $file zip archive - * @param $output + * @param mixed $output expected output * * @dataProvider providerForTestFindFileFromZipArchive + * @return void */ - public function testFindFileFromZipArchive($file_regexp, $file, $output){ + public function testFindFileFromZipArchive($file_regexp, $file, $output) + { $this->assertEquals( PMA_findFileFromZipArchive($file_regexp, $file), $output @@ -68,8 +79,11 @@ class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { /** * Provider for testFindFileFromZipArchive + * + * @return void */ - public function providerForTestFindFileFromZipArchive(){ + public function providerForTestFindFileFromZipArchive() + { return array( array( '/test/', @@ -81,8 +95,11 @@ class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { /** * Test for PMA_getNoOfFilesInZip + * + * @return void */ - public function testGetNoOfFilesInZip(){ + public function testGetNoOfFilesInZip() + { $this->assertEquals( PMA_getNoOfFilesInZip('./test/test_data/test.zip'), 1 @@ -91,10 +108,15 @@ class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { /** * Test for PMA_zipExtract + * + * @return void */ - public function testZipExtract(){ + public function testZipExtract() + { $this->assertEquals( - PMA_zipExtract('./test/test_data/test.zip', './test/test_data/', 'wrongName'), + PMA_zipExtract( + './test/test_data/test.zip', './test/test_data/', 'wrongName' + ), true ); } @@ -102,12 +124,14 @@ class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { /** * Test for PMA_getZipError * - * @param $code error code - * @param $output + * @param int $code error code + * @param mixed $output expected output * * @dataProvider providerForTestGetZipError + * @return void */ - public function testGetZipError($code, $output){ + public function testGetZipError($code, $output) + { $this->assertEquals( PMA_getZipError($code), $output @@ -116,8 +140,11 @@ class PMA_zip_extension_test extends PHPUnit_Framework_TestCase { /** * Provider for testGetZipError + * + * @return array */ - public function providerForTestGetZipError(){ + public function providerForTestGetZipError() + { return array( array( 1, From a222e1b9452142e3f372311f2d400c00cb4fedb6 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 17:22:52 +0200 Subject: [PATCH 02/12] Fix typo --- test/libraries/PMA_zip_extension_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libraries/PMA_zip_extension_test.php b/test/libraries/PMA_zip_extension_test.php index 272909675f..54049a8ee7 100644 --- a/test/libraries/PMA_zip_extension_test.php +++ b/test/libraries/PMA_zip_extension_test.php @@ -1,6 +1,6 @@ Date: Thu, 30 Aug 2012 17:25:42 +0200 Subject: [PATCH 03/12] fix coding style : control structures --- libraries/replication_gui.lib.php | 3 +-- sql.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php index 3cad0da787..d2bd825444 100644 --- a/libraries/replication_gui.lib.php +++ b/libraries/replication_gui.lib.php @@ -150,8 +150,7 @@ function PMA_replication_print_status_table($type, $hidden = false, $title = tru 'Replicate_Wild_Do_Table', 'Replicate_Wild_Ignore_Table'); if (in_array($variable, $variables_wrap)) { echo str_replace(',', ', ', ${"server_{$type}_replication"}[0][$variable]); - } - else { + } else { echo ${"server_{$type}_replication"}[0][$variable]; } echo ''; diff --git a/sql.php b/sql.php index c2d96aea6f..fd5d7dccda 100644 --- a/sql.php +++ b/sql.php @@ -1275,7 +1275,7 @@ function PMA_getNewDatabase($sql, $databases) { $db = ''; // loop through all the databases - foreach ($databases as $database){ + foreach ($databases as $database) { if (strpos($sql,$database['SCHEMA_NAME']) !== false) { $db = $database; break; From 623de27ef2d00be3bbbaa653a4422e21006a9b29 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 17:35:56 +0200 Subject: [PATCH 04/12] use include(_once) in case of conditional including --- db_operations.php | 2 +- import.php | 2 +- libraries/CommonFunctions.class.php | 2 +- libraries/Tracker.class.php | 2 +- libraries/transformations.lib.php | 2 +- sql.php | 2 +- test/classes/PMA_Theme_test.php | 2 +- test/libraries/PMA_bookmark_test.php | 2 +- view_create.php | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/db_operations.php b/db_operations.php index 2818864c6e..764b2a0cd9 100644 --- a/db_operations.php +++ b/db_operations.php @@ -66,7 +66,7 @@ if (strlen($db) && (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_cop $tables_full = PMA_DBI_get_tables_full($db); - require_once "libraries/plugin_interface.lib.php"; + include_once "libraries/plugin_interface.lib.php"; // remove all foreign key constraints, otherwise we can get errors $export_sql_plugin = PMA_getPlugin( "export", diff --git a/import.php b/import.php index 70e471b07b..f34fa70c53 100644 --- a/import.php +++ b/import.php @@ -442,7 +442,7 @@ $sql_data = array('valid_sql' => array(), 'valid_queries' => 0); if (! $error) { // Check for file existance - require_once("libraries/plugin_interface.lib.php"); + include_once "libraries/plugin_interface.lib.php"; $import_plugin = PMA_getPlugin( "import", $format, diff --git a/libraries/CommonFunctions.class.php b/libraries/CommonFunctions.class.php index f90a508b0e..3f48a40825 100644 --- a/libraries/CommonFunctions.class.php +++ b/libraries/CommonFunctions.class.php @@ -3514,7 +3514,7 @@ class PMA_CommonFunctions /* Optional escaping */ if (! is_null($escape)) { if (is_array($escape)) { - require_once $escape[2]; + include_once $escape[2]; $escape_class = new $escape[1]; $escape_method = $escape[0]; } diff --git a/libraries/Tracker.class.php b/libraries/Tracker.class.php index 9d8c430dc5..052804f10e 100644 --- a/libraries/Tracker.class.php +++ b/libraries/Tracker.class.php @@ -267,7 +267,7 @@ class PMA_Tracker } // get Export SQL instance - require_once "libraries/plugin_interface.lib.php"; + include_once "libraries/plugin_interface.lib.php"; $export_sql_plugin = PMA_getPlugin( "export", "sql", diff --git a/libraries/transformations.lib.php b/libraries/transformations.lib.php index 561406e0eb..e96049b874 100644 --- a/libraries/transformations.lib.php +++ b/libraries/transformations.lib.php @@ -146,7 +146,7 @@ function PMA_getTransformationDescription($file, $html_formatted = true) $class_name = $class_name[0]; // include and instantiate the class - require_once 'libraries/plugins/transformations/' . $file; + include_once 'libraries/plugins/transformations/' . $file; return $class_name::getInfo(); } diff --git a/sql.php b/sql.php index fd5d7dccda..fc2fa06bd2 100644 --- a/sql.php +++ b/sql.php @@ -773,7 +773,7 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { || ($analyzed_sql[0]['querytype'] == 'DROP')) ) { - require_once 'libraries/transformations.lib.php'; + include_once 'libraries/transformations.lib.php'; if ($analyzed_sql[0]['querytype'] == 'ALTER') { if (stripos($analyzed_sql[0]['unsorted_query'], 'DROP') !== false) { diff --git a/test/classes/PMA_Theme_test.php b/test/classes/PMA_Theme_test.php index 6a7c548778..4513d9df02 100644 --- a/test/classes/PMA_Theme_test.php +++ b/test/classes/PMA_Theme_test.php @@ -32,7 +32,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['cfg']['SQP']['fmtColor'] = array('fake' => 'red'); $GLOBALS['text_dir'] = 'ltr'; - require 'themes/pmahomme/layout.inc.php'; + include 'themes/pmahomme/layout.inc.php'; $_SESSION[' PMA_token '] = 'token'; $GLOBALS['lang'] = 'en'; $GLOBALS['server'] = '99'; diff --git a/test/libraries/PMA_bookmark_test.php b/test/libraries/PMA_bookmark_test.php index 9aa3775ca8..1cf7ab3ed1 100644 --- a/test/libraries/PMA_bookmark_test.php +++ b/test/libraries/PMA_bookmark_test.php @@ -45,7 +45,7 @@ class PMA_bookmark_test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['Server']['bookmarktable'] = 'pma_bookmark'; $GLOBALS['server'] = 1; - require_once 'libraries/bookmark.lib.php'; + include_once 'libraries/bookmark.lib.php'; } /** * Test for PMA_Bookmark_getParams diff --git a/view_create.php b/view_create.php index d5644fb275..b0b6e1d9ac 100644 --- a/view_create.php +++ b/view_create.php @@ -64,7 +64,7 @@ if (isset($_REQUEST['createview'])) { if (PMA_DBI_try_query($sql_query)) { - require_once './libraries/tbl_views.lib.php'; + include_once './libraries/tbl_views.lib.php'; // If different column names defined for VIEW $view_columns = array(); From 0090489babe8079b0672f98e631b8b4c2ce469db Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 17:37:19 +0200 Subject: [PATCH 05/12] use require in case of unconditional including --- libraries/error.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/error.inc.php b/libraries/error.inc.php index 22b7474ee9..7e3f8ae118 100644 --- a/libraries/error.inc.php +++ b/libraries/error.inc.php @@ -14,7 +14,7 @@ if (! defined('TESTSUITE')) { header('Content-Type: text/html; charset=utf-8'); } -include_once 'libraries/Response.class.php'; +require_once 'libraries/Response.class.php'; PMA_Response::getInstance()->disable(); ?> From a9c4a1a5e55d910d1fce215ca39b803f4b7b4017 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 17:41:33 +0200 Subject: [PATCH 06/12] fix coding style --- db_operations.php | 4 ++-- tbl_operations.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/db_operations.php b/db_operations.php index 764b2a0cd9..bed41307b5 100644 --- a/db_operations.php +++ b/db_operations.php @@ -77,8 +77,8 @@ if (strlen($db) && (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_cop 'export_type' => 'database' ) ); - $GLOBALS['sql_constraints_query_full_db'] = - PMA_getSqlConstraintsQueryForFullDb( + $GLOBALS['sql_constraints_query_full_db'] + = PMA_getSqlConstraintsQueryForFullDb( $tables_full, $export_sql_plugin, $move, $db ); diff --git a/tbl_operations.php b/tbl_operations.php index f0373e9549..404884dffd 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -118,8 +118,7 @@ if (isset($_REQUEST['submitoptions'])) { ) = PMA_setGlobalVariablesForEngine($tbl_storage_engine); if ($is_aria) { - $transactional = - (isset($transactional) && $transactional == '0') + $transactional = (isset($transactional) && $transactional == '0') ? '0' : '1'; $page_checksum = (isset($page_checksum)) ? $page_checksum : ''; From 686dae34bb83a5d8f270c799ee8419f0fdc4284e Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 17:48:54 +0200 Subject: [PATCH 07/12] fix coding style : wrap long lines --- tbl_change.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tbl_change.php b/tbl_change.php index ce3237db87..3c60e786db 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -343,14 +343,17 @@ foreach ($rows as $row_id => $current_row) { $html_output .= ' ' . "\n"; // Will be used by js/tbl_change.js to set the default value // for the "Continue insertion" feature - $html_output .= '' . $special_chars . ''; + $html_output .= '' + . $special_chars . ''; $html_output .= PMA_getValueColumn( - $column, $backup_field, $column_name_appendix, $unnullify_trigger,$tabindex, - $tabindex_for_value, $idindex, $data,$special_chars, $foreignData, $odd_row, - $paramTableDbArray,$rownumber_param, $titles, $text_dir, $special_chars_encoded, - $vkey,$is_upload, $biggest_max_file_size, $default_char_editing, - $no_support_types, $gis_data_types, $extracted_columnspec); + $column, $backup_field, $column_name_appendix, $unnullify_trigger, + $tabindex, $tabindex_for_value, $idindex, $data, $special_chars, + $foreignData, $odd_row, $paramTableDbArray, $rownumber_param, $titles, + $text_dir, $special_chars_encoded, $vkey, $is_upload, + $biggest_max_file_size, $default_char_editing, + $no_support_types, $gis_data_types, $extracted_columnspec + ); $html_output .= '' . ''; From 112f8b92e348c6930d0b642eb800115038a0567a Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 17:56:11 +0200 Subject: [PATCH 08/12] fix coding style : correct function parameter spacing --- db_structure.php | 4 ++-- libraries/mult_submits.inc.php | 2 +- libraries/transformations.lib.php | 2 +- sql.php | 4 ++-- tbl_operations.php | 4 ++-- tbl_structure.php | 2 +- tbl_tracking.php | 4 ++-- test/classes/PMA_List_Database_test.php | 2 +- test/classes/PMA_Theme_Manager_test.php | 6 +++--- test/classes/PMA_Theme_test.php | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/db_structure.php b/db_structure.php index 95c2fc4959..7d71d7562d 100644 --- a/db_structure.php +++ b/db_structure.php @@ -271,9 +271,9 @@ foreach ($tables as $keyname => $current_table) { list($html_output, $odd_row) = PMA_getHtmlForStructureTableRow( $i, $odd_row, $table_is_view, $current_table, $checked, - $browse_table_label, $tracking_icon,$server_slave_status, + $browse_table_label, $tracking_icon, $server_slave_status, $browse_table, $tbl_url_query, $search_table, $db_is_information_schema, - $titles, $empty_table,$drop_query, $drop_message, $collation, + $titles, $empty_table, $drop_query, $drop_message, $collation, $formatted_size, $unit, $overhead, (isset ($create_time) ? $create_time : ''), (isset ($update_time) ? $update_time : ''), diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index 3008805431..4fc5c747ee 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -496,7 +496,7 @@ if (!empty($submit_mult) && !empty($what)) { } elseif ($query_type == 'drop_tbl') { PMA_clearTransformations($db, $selected[$i]); } else if ($query_type == 'drop_fld') { - PMA_clearTransformations($db, $table ,$selected[$i]); + PMA_clearTransformations($db, $table, $selected[$i]); } } // end if diff --git a/libraries/transformations.lib.php b/libraries/transformations.lib.php index e96049b874..1eaddb5a69 100644 --- a/libraries/transformations.lib.php +++ b/libraries/transformations.lib.php @@ -268,7 +268,7 @@ function PMA_setMIME($db, $table, $key, $mimetype, $transformation, $transformation = strtolower($transformation); $transformation = str_replace(".class.php", ".inc.php", $transformation); $last_pos = strrpos($transformation, "_"); - $transformation = substr($transformation , 0, $last_pos) . "_" + $transformation = substr($transformation, 0, $last_pos) . "_" . substr($transformation, $last_pos); $test_qry = ' diff --git a/sql.php b/sql.php index fc2fa06bd2..67fe696e9f 100644 --- a/sql.php +++ b/sql.php @@ -1276,7 +1276,7 @@ function PMA_getNewDatabase($sql, $databases) $db = ''; // loop through all the databases foreach ($databases as $database) { - if (strpos($sql,$database['SCHEMA_NAME']) !== false) { + if (strpos($sql, $database['SCHEMA_NAME']) !== false) { $db = $database; break; } @@ -1301,7 +1301,7 @@ function PMA_getTableNameBySQL($sql, $tables) // loop through all the tables in the database foreach ($tables as $tbl) { - if (strpos($sql,$tbl)) { + if (strpos($sql, $tbl)) { $table .= ' ' . $tbl; } } diff --git a/tbl_operations.php b/tbl_operations.php index 404884dffd..6de818bac3 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -324,8 +324,8 @@ if (! (isset($db_is_information_schema) && $db_is_information_schema)) { ($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped') - ) - , htmlspecialchars($table) + ), + htmlspecialchars($table) ), // table name is needed to avoid running // PMA_relationsCleanupDatabase() on the whole db later diff --git a/tbl_structure.php b/tbl_structure.php index 4de2e5528f..723dc5c29c 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -315,7 +315,7 @@ foreach ($fields as $row) { PMA_getHtmlTableStructureRow($row, $rownum, $checked, $displayed_field_name, $type_nowrap, $extracted_columnspec, $type_mime, $field_charset, $attribute, $tbl_is_view, - $db_is_information_schema,$url_query, $field_encoded, $titles, $table + $db_is_information_schema, $url_query, $field_encoded, $titles, $table ) ); diff --git a/tbl_tracking.php b/tbl_tracking.php index da28b99b7b..cb434fb781 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -292,8 +292,8 @@ if (isset($_REQUEST['snapshot'])) { // Print SQL code echo $common_functions->getMessage( sprintf( - __('Version %s snapshot (SQL code)') - , htmlspecialchars($_REQUEST['version']) + __('Version %s snapshot (SQL code)'), + htmlspecialchars($_REQUEST['version']) ), $drop_create_statements ); diff --git a/test/classes/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php index ea91f3d25d..8a592021ae 100644 --- a/test/classes/PMA_List_Database_test.php +++ b/test/classes/PMA_List_Database_test.php @@ -135,7 +135,7 @@ class PMA_List_Database_test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['LeftFrameDBSeparator'] = array('|',','); $this->assertEquals( - $this->object->getHtmlListGrouped(true,5,5), + $this->object->getHtmlListGrouped(true, 5, 5), '
' ); diff --git a/test/classes/PMA_Theme_Manager_test.php b/test/classes/PMA_Theme_Manager_test.php index f76d49e9aa..7e20d743cd 100644 --- a/test/classes/PMA_Theme_Manager_test.php +++ b/test/classes/PMA_Theme_Manager_test.php @@ -79,9 +79,9 @@ class PMA_Theme_Manager_test extends PHPUnit_Framework_TestCase $this->assertNull( $tm->makeBc() ); - $this->assertEquals($GLOBALS['theme'],'pmahomme'); - $this->assertEquals($GLOBALS['pmaThemePath'],'./themes/pmahomme'); - $this->assertEquals($GLOBALS['pmaThemeImage'],'./themes/pmahomme/img/'); + $this->assertEquals($GLOBALS['theme'], 'pmahomme'); + $this->assertEquals($GLOBALS['pmaThemePath'], './themes/pmahomme'); + $this->assertEquals($GLOBALS['pmaThemeImage'], './themes/pmahomme/img/'); } diff --git a/test/classes/PMA_Theme_test.php b/test/classes/PMA_Theme_test.php index 4513d9df02..4570ce885f 100644 --- a/test/classes/PMA_Theme_test.php +++ b/test/classes/PMA_Theme_test.php @@ -254,7 +254,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase '14px' ); - $GLOBALS['PMA_Config']->set('fontsize','12px'); + $GLOBALS['PMA_Config']->set('fontsize', '12px'); $this->assertEquals( $this->object->getFontSize(), '12px' From fd2118f182244f51f7f897fd170909c6686bef45 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 30 Aug 2012 18:03:26 +0200 Subject: [PATCH 09/12] fix coding style --- test/classes/gis/PMA_GIS_Linestring_test.php | 75 ++++++++++++-------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/test/classes/gis/PMA_GIS_Linestring_test.php b/test/classes/gis/PMA_GIS_Linestring_test.php index cbd00e5229..6a12feaa85 100644 --- a/test/classes/gis/PMA_GIS_Linestring_test.php +++ b/test/classes/gis/PMA_GIS_Linestring_test.php @@ -172,17 +172,20 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest * @param type $image * @param type $output * - *@dataProvider providerForPrepareRowAsPng + * @dataProvider providerForPrepareRowAsPng + * @return void */ - public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) - { - - $return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image); + public function testPrepareRowAsPng($spatial, $label, $line_color, + $scale_data, $image, $output + ) { + $return = $this->object->prepareRowAsPng( + $spatial, $label, $line_color, $scale_data, $image + ); $this->assertTrue(true); } - public function providerForPrepareRowAsPng(){ - + public function providerForPrepareRowAsPng() + { return array( array( 'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)', @@ -194,10 +197,9 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest 'scale' => 2, 'height' => 150 ), - imagecreatetruecolor('120','150'), + imagecreatetruecolor('120', '150'), '' ) - ); } @@ -209,17 +211,20 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest * @param type $scale_data * @param type $pdf * - *@dataProvider providerForPrepareRowAsPdf + * @dataProvider providerForPrepareRowAsPdf + * @return void */ - public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) - { - - $return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf); + public function testPrepareRowAsPdf($spatial, $label, $line_color, + $scale_data, $pdf + ) { + $return = $this->object->prepareRowAsPdf( + $spatial, $label, $line_color, $scale_data, $pdf + ); $this->assertTrue($return instanceof TCPDF); } - public function providerForPrepareRowAsPdf(){ - + public function providerForPrepareRowAsPdf() + { return array( array( 'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)', @@ -244,18 +249,20 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest * @param type $scale_data * @param type $output * - *@dataProvider providerForPrepareRowAsSvg + * @dataProvider providerForPrepareRowAsSvg + * @return void */ - public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) - { - - $string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data); + public function testPrepareRowAsSvg($spatial, $label, $line_color, + $scale_data, $output + ) { + $string = $this->object->prepareRowAsSvg( + $spatial, $label, $line_color, $scale_data + ); $this->assertEquals(1, preg_match($output, $string)); - //$this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output); } - public function providerForPrepareRowAsSvg(){ - + public function providerForPrepareRowAsSvg() + { return array( array( 'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)', @@ -281,16 +288,22 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest * @param type $scale_data * @param type $output * - *@dataProvider providerForPrepareRowAsOl + * @dataProvider providerForPrepareRowAsOl + * @return void */ - public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) - { - - $this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output); + public function testPrepareRowAsOl($spatial, $srid, $label, + $line_color, $scale_data, $output + ) { + $this->assertEquals( + $this->object->prepareRowAsOl( + $spatial, $srid, $label, $line_color, $scale_data + ), + $output + ); } - public function providerForPrepareRowAsOl(){ - + public function providerForPrepareRowAsOl() + { return array( array( 'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)', From faf60a4e52f4ad7f3a36ad66d404840bd8aecafd Mon Sep 17 00:00:00 2001 From: Guto Rocha Date: Thu, 30 Aug 2012 13:48:45 +0200 Subject: [PATCH 10/12] Translated using Weblate. --- po/pt_BR.po | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 423428e1a8..70ea5e3f9d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-08-28 14:48+0200\n" -"PO-Revision-Date: 2012-08-29 21:15+0200\n" -"Last-Translator: Alexander Luiz Marinho \n" +"PO-Revision-Date: 2012-08-30 13:47+0200\n" +"Last-Translator: Guto Rocha \n" "Language-Team: Portuguese (Brazil) " "\n" "Language: pt_BR\n" @@ -10155,9 +10155,8 @@ msgid "subquery" msgstr "na consulta" #: pmd_general.php:521 pmd_general.php:617 -#, fuzzy msgid "Rename to" -msgstr "Renomear a tabela para " +msgstr "Renomear para " #: pmd_general.php:523 pmd_general.php:622 #, fuzzy From f4242416cb1f3f199f8fd62199ccef956fb50a4d Mon Sep 17 00:00:00 2001 From: gurjit dhillon Date: Thu, 30 Aug 2012 16:42:57 +0200 Subject: [PATCH 11/12] Translated using Weblate. --- po/pa.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/po/pa.po b/po/pa.po index e2d14d86c4..b39cfc9a4c 100644 --- a/po/pa.po +++ b/po/pa.po @@ -8,10 +8,10 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-08-28 14:48+0200\n" -"PO-Revision-Date: 2012-08-25 06:45+0200\n" +"PO-Revision-Date: 2012-08-30 16:42+0200\n" "Last-Translator: gurjit dhillon \n" -"Language-Team: Panjabi \n" +"Language-Team: Punjabi " +"\n" "Language: pa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,7 +23,7 @@ msgstr "" #: libraries/DisplayResults.class.php:816 #: libraries/server_privileges.lib.php:2640 msgid "Show all" -msgstr "login" +msgstr "ਸਾਰੇ ਦਿਖ਼ਾਓ" #: browse_foreigners.php:77 libraries/CommonFunctions.class.php:2675 #: libraries/PDF.class.php:50 @@ -32,7 +32,7 @@ msgstr "login" #: libraries/schema/User_Schema.class.php:417 #: libraries/select_lang.lib.php:510 msgid "Page number:" -msgstr "" +msgstr "ਪੰਨਾ ਨੰਬਰ" #: browse_foreigners.php:94 msgid "" @@ -47,7 +47,7 @@ msgstr "" #: libraries/CommonFunctions.class.php:3665 libraries/Menu.class.php:264 #: libraries/Menu.class.php:353 msgid "Search" -msgstr "" +msgstr "ਲੱਭੋ" #: browse_foreigners.php:171 gis_data_editor.php:304 js/messages.php:231 #: libraries/DbSearch.class.php:479 libraries/DisplayResults.class.php:1666 @@ -85,7 +85,7 @@ msgstr "" #: tbl_tracking.php:497 tbl_tracking.php:639 view_create.php:221 #: view_operations.php:96 msgid "Go" -msgstr "" +msgstr "ਚੱਲੋ" #: browse_foreigners.php:186 browse_foreigners.php:190 #: libraries/Index.class.php:463 tbl_tracking.php:373 From c49a5df9a3a66e2dd9eb35fd90c95f0797b0db99 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 30 Aug 2012 22:03:07 +0530 Subject: [PATCH 12/12] Remove tabs and trailing white spaces --- js/tbl_zoom_plot_jqplot.js | 26 ++++++------ libraries/rte/rte_routines.lib.php | 68 +++++++++++++++--------------- libraries/structure.lib.php | 2 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/js/tbl_zoom_plot_jqplot.js b/js/tbl_zoom_plot_jqplot.js index 4c3b0706fa..cb01a35a7f 100644 --- a/js/tbl_zoom_plot_jqplot.js +++ b/js/tbl_zoom_plot_jqplot.js @@ -142,10 +142,10 @@ $(document).ready(function() { $('#tableFieldsId tr:eq(1) td:eq(1)').html(data.field_collation); $('#tableFieldsId tr:eq(1) td:eq(2)').html(data.field_operators); $('#tableFieldsId tr:eq(1) td:eq(3)').html(data.field_value); - xLabel = $('#tableid_0').val(); - $('#types_0').val(data.field_type); + xLabel = $('#tableid_0').val(); + $('#types_0').val(data.field_type); xType = data.field_type; - $('#collations_0').val(data.field_collations); + $('#collations_0').val(data.field_collations); addDateTimePicker(); }); }); @@ -153,7 +153,7 @@ $(document).ready(function() { // second column choice corresponds to the Y axis $('#tableid_1').change(function() { //AJAX request for field type, collation, operators, and value field - $.post('tbl_zoom_select.php',{ + $.post('tbl_zoom_select.php',{ 'ajax_request' : true, 'change_tbl_info' : true, 'db' : window.parent.db, @@ -166,17 +166,17 @@ $(document).ready(function() { $('#tableFieldsId tr:eq(3) td:eq(1)').html(data.field_collation); $('#tableFieldsId tr:eq(3) td:eq(2)').html(data.field_operators); $('#tableFieldsId tr:eq(3) td:eq(3)').html(data.field_value); - yLabel = $('#tableid_1').val(); - $('#types_1').val(data.field_type); + yLabel = $('#tableid_1').val(); + $('#types_1').val(data.field_type); yType = data.field_type; - $('#collations_1').val(data.field_collations); + $('#collations_1').val(data.field_collations); addDateTimePicker(); }); }); $('#tableid_2').change(function() { //AJAX request for field type, collation, operators, and value field - $.post('tbl_zoom_select.php',{ + $.post('tbl_zoom_select.php',{ 'ajax_request' : true, 'change_tbl_info' : true, 'db' : window.parent.db, @@ -189,15 +189,15 @@ $(document).ready(function() { $('#tableFieldsId tr:eq(6) td:eq(1)').html(data.field_collation); $('#tableFieldsId tr:eq(6) td:eq(2)').html(data.field_operators); $('#tableFieldsId tr:eq(6) td:eq(3)').html(data.field_value); - $('#types_2').val(data.field_type); - $('#collations_2').val(data.field_collations); + $('#types_2').val(data.field_type); + $('#collations_2').val(data.field_collations); addDateTimePicker(); }); }); $('#tableid_3').change(function() { //AJAX request for field type, collation, operators, and value field - $.post('tbl_zoom_select.php',{ + $.post('tbl_zoom_select.php',{ 'ajax_request' : true, 'change_tbl_info' : true, 'db' : window.parent.db, @@ -210,8 +210,8 @@ $(document).ready(function() { $('#tableFieldsId tr:eq(8) td:eq(1)').html(data.field_collation); $('#tableFieldsId tr:eq(8) td:eq(2)').html(data.field_operators); $('#tableFieldsId tr:eq(8) td:eq(3)').html(data.field_value); - $('#types_3').val(data.field_type); - $('#collations_3').val(data.field_collations); + $('#types_3').val(data.field_type); + $('#collations_3').val(data.field_collations); addDateTimePicker(); }); }); diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php index 8c13151c59..978141e91a 100644 --- a/libraries/rte/rte_routines.lib.php +++ b/libraries/rte/rte_routines.lib.php @@ -264,7 +264,7 @@ function PMA_RTN_parseRoutineDefiner($parsed_query) function PMA_RTN_handleEditor() { global $_GET, $_POST, $_REQUEST, $GLOBALS, $db, $errors; - + $common_functions = PMA_CommonFunctions::getInstance(); if (! empty($_REQUEST['editor_process_add']) @@ -443,7 +443,7 @@ function PMA_RTN_handleEditor() function PMA_RTN_getDataFromRequest() { global $_REQUEST, $param_directions, $param_sqldataaccess; - + $common_functions = PMA_CommonFunctions::getInstance(); $retval = array(); @@ -689,7 +689,7 @@ function PMA_RTN_getDataFromName($name, $type, $all = true) function PMA_RTN_getParameterRow($routine = array(), $index = null, $class = '') { global $param_directions, $param_opts_num, $titles; - + $common_functions = PMA_CommonFunctions::getInstance(); if ($index === null) { @@ -1045,7 +1045,7 @@ function PMA_RTN_getQueryFromRequest() { global $_REQUEST, $errors, $param_sqldataaccess, $param_directions; - $common_functions = PMA_CommonFunctions::getInstance(); + $common_functions = PMA_CommonFunctions::getInstance(); $_REQUEST['item_type'] = isset($_REQUEST['item_type']) ? $_REQUEST['item_type'] : ''; @@ -1202,7 +1202,7 @@ function PMA_RTN_getQueryFromRequest() function PMA_RTN_handleExecute() { global $_GET, $_POST, $_REQUEST, $GLOBALS, $db; - + $common_functions = PMA_CommonFunctions::getInstance(); /** @@ -1253,26 +1253,26 @@ function PMA_RTN_handleExecute() . "(" . implode(', ', $args) . ") " . "AS " . $common_functions->backquote($routine['item_name']) . ";\n"; } - + // Get all the queries as one SQL statement $multiple_query = implode("", $queries); - + $outcome = true; $affected = 0; - + // Execute query if (! PMA_DBI_try_multi_query($multiple_query)) { $outcome = false; } - + // Generate output if ($outcome) { - + // Pass the SQL queries through the "pretty printer" $output = ''; $output .= PMA_SQP_formatHtml(PMA_SQP_parse(implode($queries))); $output .= ''; - + // Display results $output .= "
"; $output .= sprintf( @@ -1280,26 +1280,26 @@ function PMA_RTN_handleExecute() $common_functions->backquote(htmlspecialchars($routine['item_name'])) ); $output .= ""; - + $num_of_rusults_set_to_display = 0; - + do { - + $result = PMA_DBI_store_result(); $num_rows = PMA_DBI_num_rows($result); - + if (($result !== false) && ($num_rows > 0)) { - - $output .= ""; + + $output .= "
"; foreach (PMA_DBI_get_fields_meta($result) as $key => $field) { $output .= ""; - } + } $output .= ""; - + $color_class = 'odd'; - + while ($row = PMA_DBI_fetch_assoc($result)) { $output .= ""; foreach ($row as $key => $value) { @@ -1313,30 +1313,30 @@ function PMA_RTN_handleExecute() $output .= ""; $color_class = ($color_class == 'odd') ? 'even' : 'odd'; } - + $output .= "
"; $output .= htmlspecialchars($field->name); $output .= "
"; $num_of_rusults_set_to_display++; $affected = $num_rows; - + } - + if (! PMA_DBI_more_results()) { break; } - + $output .= "
"; - + PMA_DBI_free_result($result); - + } while (PMA_DBI_next_result()); - + $output .= "
"; - + $message = __('Your SQL query has been executed successfully'); if ($routine['item_type'] == 'PROCEDURE') { $message .= '
'; - - // TODO : message need to be modified according to the + + // TODO : message need to be modified according to the // output from the routine $message .= sprintf( _ngettext( @@ -1348,12 +1348,12 @@ function PMA_RTN_handleExecute() ); } $message = PMA_message::success($message); - + if ($num_of_rusults_set_to_display == 0) { $notice = __('MySQL returned an empty result set (i.e. zero rows).'); $output .= PMA_message::notice($notice)->getDisplay(); } - + } else { $output = ''; $message = PMA_message::error( @@ -1365,7 +1365,7 @@ function PMA_RTN_handleExecute() . __('MySQL said: ') . PMA_DBI_getError(null) ); } - + // Print/send output if ($GLOBALS['is_ajax_request']) { $response = PMA_Response::getInstance(); @@ -1449,7 +1449,7 @@ function PMA_RTN_handleExecute() function PMA_RTN_getExecuteForm($routine) { global $db, $cfg; - + $common_functions = PMA_CommonFunctions::getInstance(); // Escape special characters diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index c27c1784c1..131e7c603b 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -64,7 +64,7 @@ function PMA_getHtmlForActionLinks($current_table, $table_is_view, $tbl_url_quer $empty_table .= ' href="sql.php?' . $tbl_url_query . '&sql_query='; $empty_table .= urlencode( - 'TRUNCATE ' . $common_functions->backquote($current_table['TABLE_NAME']) + 'TRUNCATE ' . $common_functions->backquote($current_table['TABLE_NAME']) ); $empty_table .= '&message_to_show=' . urlencode(