Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2012-08-30 18:04:13 +02:00
commit 4d14e99d16
21 changed files with 127 additions and 86 deletions

View File

@ -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",
@ -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
);

View File

@ -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 : ''),

View File

@ -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,

View File

@ -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];
}

View File

@ -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",

View File

@ -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();
?>

View File

@ -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

View File

@ -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 '</span>';

View File

@ -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();
}
@ -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 = '

View File

@ -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) {
@ -1275,8 +1275,8 @@ function PMA_getNewDatabase($sql, $databases)
{
$db = '';
// loop through all the databases
foreach ($databases as $database){
if (strpos($sql,$database['SCHEMA_NAME']) !== false) {
foreach ($databases as $database) {
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;
}
}

View File

@ -343,14 +343,17 @@ foreach ($rows as $row_id => $current_row) {
$html_output .= ' <td>' . "\n";
// Will be used by js/tbl_change.js to set the default value
// for the "Continue insertion" feature
$html_output .= '<span class="default_value hide">' . $special_chars . '</span>';
$html_output .= '<span class="default_value hide">'
. $special_chars . '</span>';
$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 .= '</td>'
. '</tr>';

View File

@ -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 : '';
@ -325,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

View File

@ -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
)
);

View File

@ -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
);

View File

@ -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),
'<ul id="databaseList" lang="en" dir="ltr">
</ul>'
);

View File

@ -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/');
}

View File

@ -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';
@ -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'

View File

@ -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)',

View File

@ -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

View File

@ -1,6 +1,6 @@
<?php
/**
* Tests for displaing results
* Tests for displaying results
*
* @package PhpMyAdmin-test
*/
@ -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,

View File

@ -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();