Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into drizzle
Browse files Browse the repository at this point in the history
Conflicts:
	server_status.php
  • Loading branch information
piotrp committed Jul 20, 2011
2 parents 738228a + 4ee15be commit 6dbcab2
Show file tree
Hide file tree
Showing 195 changed files with 71,123 additions and 40,817 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ phpmyadmin.wpj
.buildpath
.cache
.idea
.netbeans
*.sw[op]
# Locales
/locale/
Expand All @@ -31,3 +32,8 @@ phpmyadmin.wpj
/apidoc/
# Demo server
revision-info.php
# PHPUnit
phpunit.xml
/test/bootstrap.php
# Jenkins
/build/
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ phpMyAdmin - ChangeLog
+ AJAX for table Structure column Change
+ [interface] Improved support for events
+ [interface] Improved support for triggers
+ [interface] Improved server monitoring

3.4.4.0 (not yet released)
- bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes
Expand Down
2 changes: 1 addition & 1 deletion bs_disp_as_mime_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
PMA_checkParameters(array('reference', 'c_type'));

// Increase time limit, because fetching blob might take some time
set_time_limit(0);
@set_time_limit(0);

$reference = $_REQUEST['reference'];
/*
Expand Down
87 changes: 87 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="phpMyAdmin" default="build" basedir=".">
<property name="source" value="."/>
<property name="source_comma_sep" value="."/>

<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>

<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>

<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<exec executable="phpunit">
<arg line="--configuration phpunit.xml.dist"/>
</exec>
</target>

<target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<exec executable="pdepend">
<arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml
--jdepend-chart=${basedir}/build/pdepend/dependencies.svg
--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
${source_comma_sep}" />
</exec>
</target>

<target name="phpmd" description="Generate pmd.xml using PHPMD">
<exec executable="phpmd">
<arg line="${source_comma_sep}
xml
codesize,design,naming,unusedcode
--reportfile ${basedir}/build/logs/pmd.xml" />
</exec>
</target>

<target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
<exec executable="phpcpd">
<arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml
--exclude test
--exclude libraries/PHPExcel
--exclude libraries/tcpdf
${source}" />
</exec>
</target>

<target name="phploc" description="Generate phploc.csv">
<exec executable="phploc">
<arg line="--log-csv ${basedir}/build/logs/phploc.csv ${source}" />
</exec>
</target>

<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding test, PHPExcel, tcpdf directories">
<exec executable="phpcs">
<arg line="-v
--ignore=*/PHPExcel/*,*/php-gettext/*,*/tcpdf/*
--report=checkstyle
--report-file=${basedir}/build/logs/checkstyle.xml
--standard=PEAR
${source}" />
</exec>
</target>

<target name="phpdoc" description="Generate API documentation using PHPDocumentor">
<exec executable="phpdoc">
<arg line="-d ${source} -t ${basedir}/build/api" />
</exec>
</target>

<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg line="--log ${basedir}/build/logs
--source ${source}
--output ${basedir}/build/code-browser" />
</exec>
</target>

<target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb"/>
</project>
12 changes: 6 additions & 6 deletions chart_export.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
*/


define('PMA_MINIMUM_COMMON',true);
define('PMA_MINIMUM_COMMON', true);

require_once './libraries/common.inc.php';

if(isset($_REQUEST['filename']) && isset($_REQUEST['image'])) {
$allowed = Array( 'image/png'=>'png', 'image/svg+xml'=>'svg');

if(!isset($allowed[$_REQUEST['type']])) exit('Invalid export type');
if(! isset($allowed[$_REQUEST['type']])) exit('Invalid export type');

if(!preg_match("/(".implode("|",$allowed).")$/i",$_REQUEST['filename']))
$_REQUEST['filename'].='.'.$allowed[$_REQUEST['type']];
if(! preg_match("/(".implode("|",$allowed).")$/i", $_REQUEST['filename']))
$_REQUEST['filename'] .= '.' . $allowed[$_REQUEST['type']];

header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$_REQUEST['filename']);
header("Content-Type: ".$_REQUEST['type']);
header("Content-Transfer-Encoding: binary");

if($allowed[$_REQUEST['type']]!='svg')
echo base64_decode(substr($_REQUEST['image'],strpos($_REQUEST['image'],',')+1));
if($allowed[$_REQUEST['type']] != 'svg')
echo base64_decode(substr($_REQUEST['image'], strpos($_REQUEST['image'],',') + 1));
else
echo $_REQUEST['image'];

Expand Down
2 changes: 2 additions & 0 deletions db_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
$GLOBALS['js_include'][] = 'jquery/timepicker.js';
$GLOBALS['js_include'][] = 'rte/common.js';
$GLOBALS['js_include'][] = 'rte/events.js';
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';

/**
* Include all other files
Expand Down
2 changes: 2 additions & 0 deletions db_routines.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
$GLOBALS['js_include'][] = 'jquery/timepicker.js';
$GLOBALS['js_include'][] = 'rte/common.js';
$GLOBALS['js_include'][] = 'rte/routines.js';
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';

/**
* Include all other files
Expand Down
2 changes: 2 additions & 0 deletions db_sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
$GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'makegrid.js';
$GLOBALS['js_include'][] = 'sql.js';
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';

require './libraries/db_common.inc.php';
require_once './libraries/sql_query_form.lib.php';
Expand Down
2 changes: 2 additions & 0 deletions db_triggers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
$GLOBALS['js_include'][] = 'rte/common.js';
$GLOBALS['js_include'][] = 'rte/triggers.js';
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';

/**
* Include all other files
Expand Down
75 changes: 55 additions & 20 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,13 +723,13 @@ var last_shift_clicked_row = -1;
* Row highlighting in horizontal mode (use "live"
* so that it works also for pages reached via AJAX)
*/
$(document).ready(function() {
/*$(document).ready(function() {
$('tr.odd, tr.even').live('hover',function(event) {
var $tr = $(this);
$tr.toggleClass('hover',event.type=='mouseover');
$tr.children().toggleClass('hover',event.type=='mouseover');
});
})
})*/

/**
* This array is used to remember mark status of rows in browse mode
Expand Down Expand Up @@ -1461,20 +1461,26 @@ function PMA_createChart(passedSettings) {
chart: {
type: 'spline',
marginRight: 10,
backgroundColor: 'transparent',
events: {
/* Live charting support */
load: function() {
var thisChart = this;
var lastValue = null, curValue = null;
var numLoadedPoints = 0, otherSum = 0;
var diff;
// No realtime updates for graphs that are being exported, and disabled when no callback is set

// No realtime updates for graphs that are being exported, and disabled when realtime is not set
// Also don't do live charting if we don't have the server time
if(thisChart.options.chart.forExport == true ||
! passedSettings.realtime ||
! passedSettings.realtime.callback) return;
! thisChart.options.realtime ||
! thisChart.options.realtime.callback ||
! server_time_diff) return;

thisChart.options.realtime.timeoutCallBack = function() {
$.post(passedSettings.realtime.url,
{ ajax_request: true, chart_data: 1, type: passedSettings.realtime.type },
thisChart.options.realtime.postRequest = $.post(
thisChart.options.realtime.url,
thisChart.options.realtime.postData,
function(data) {
curValue = jQuery.parseJSON(data);

Expand All @@ -1487,13 +1493,13 @@ function PMA_createChart(passedSettings) {
false
);

passedSettings.realtime.callback(thisChart,curValue,lastValue,numLoadedPoints);
thisChart.options.realtime.callback(thisChart,curValue,lastValue,numLoadedPoints);

lastValue = curValue;
numLoadedPoints++;

// Timeout has been cleared => don't start a new timeout
if(chart_activeTimeouts[container]==null) return;
if(chart_activeTimeouts[container] == null) return;

chart_activeTimeouts[container] = setTimeout(
thisChart.options.realtime.timeoutCallBack,
Expand All @@ -1502,7 +1508,7 @@ function PMA_createChart(passedSettings) {
});
}

chart_activeTimeouts[container] = setTimeout(thisChart.options.realtime.timeoutCallBack, 0);
chart_activeTimeouts[container] = setTimeout(thisChart.options.realtime.timeoutCallBack, 5);
}
}
},
Expand Down Expand Up @@ -1544,15 +1550,20 @@ function PMA_createChart(passedSettings) {
}

/* Set/Get realtime chart default values */
if(passedSettings.realtime) {
if(passedSettings.realtime) {
if(!passedSettings.realtime.refreshRate)
passedSettings.realtime.refreshRate = 5000;

if(!passedSettings.realtime.numMaxPoints)
passedSettings.realtime.numMaxPoints = 30;

settings.xAxis.min = new Date().getTime() - passedSettings.realtime.numMaxPoints * passedSettings.realtime.refreshRate;
settings.xAxis.max = new Date().getTime() + passedSettings.realtime.refreshRate / 4;
// Allow custom POST vars to be added
passedSettings.realtime.postData = $.extend(false,{ ajax_request: true, chart_data: 1, type: passedSettings.realtime.type },passedSettings.realtime.postData);

if(server_time_diff) {
settings.xAxis.min = new Date().getTime() - server_time_diff - passedSettings.realtime.numMaxPoints * passedSettings.realtime.refreshRate;
settings.xAxis.max = new Date().getTime() - server_time_diff + passedSettings.realtime.refreshRate;
}
}

// Overwrite/Merge default settings with passedsettings
Expand Down Expand Up @@ -2564,10 +2575,10 @@ $(document).ready(function() {
$('.vpointer').live('hover',
//handlerInOut
function(e) {
var $this_td = $(this);
var row_num = PMA_getRowNumber($this_td.attr('class'));
// for all td of the same vertical row, toggle hover
$('.vpointer').filter('.row_' + row_num).toggleClass('hover');
var $this_td = $(this);
var row_num = PMA_getRowNumber($this_td.attr('class'));
// for all td of the same vertical row, toggle hover
$('.vpointer').filter('.row_' + row_num).toggleClass('hover');
}
);
}) // end of $(document).ready() for vertical pointer
Expand All @@ -2577,11 +2588,35 @@ $(document).ready(function() {
* Vertical marker
*/
$('.vmarker').live('click', function(e) {
// do not trigger when clicked on anchor
if ($(e.target).is('a, img, a *')) {
return;
}

var $this_td = $(this);
var row_num = PMA_getRowNumber($this_td.attr('class'));
// for all td of the same vertical row, toggle the marked class
$('.vmarker').filter('.row_' + row_num).toggleClass('marked');
});

// XXX: FF fires two click events for <label> (label and checkbox), so we need to handle this differently
var $tr = $(this);
var $checkbox = $('.vmarker').filter('.row_' + row_num + ':first').find(':checkbox');
if ($checkbox.length) {
// checkbox in a row, add or remove class depending on checkbox state
var checked = $checkbox.attr('checked');
if (!$(e.target).is(':checkbox, label')) {
checked = !checked;
$checkbox.attr('checked', checked);
}
// for all td of the same vertical row, toggle the marked class
if (checked) {
$('.vmarker').filter('.row_' + row_num).addClass('marked');
} else {
$('.vmarker').filter('.row_' + row_num).removeClass('marked');
}
} else {
// normaln data table, just toggle class
$('.vmarker').filter('.row_' + row_num).toggleClass('marked');
}
});

/**
* Reveal visual builder anchor
Expand Down
Loading

0 comments on commit 6dbcab2

Please sign in to comment.