You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-28 07:41:55 +03:00
26
export.php
26
export.php
@@ -21,16 +21,16 @@ if (!defined('TESTSUITE')) {
|
||||
include_once 'libraries/zip.lib.php';
|
||||
include_once 'libraries/plugin_interface.lib.php';
|
||||
|
||||
//check if its the GET request to check export time out
|
||||
//check if it's the GET request to check export time out
|
||||
if (isset($_GET['check_time_out'])) {
|
||||
if(isset($_SESSION['pma_export_error'])) {
|
||||
if (isset($_SESSION['pma_export_error'])) {
|
||||
$err = $_SESSION['pma_export_error'];
|
||||
unset($_SESSION['pma_export_error']);
|
||||
echo $err;
|
||||
} else {
|
||||
echo "success";
|
||||
}
|
||||
return;
|
||||
exit;
|
||||
}
|
||||
/**
|
||||
* Sets globals from $_POST
|
||||
@@ -266,15 +266,21 @@ if (!defined('TESTSUITE')) {
|
||||
// We send fake headers to avoid browser timeout when buffering
|
||||
$time_start = time();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a session variable upon a possible fatal error during export
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_shutdown()
|
||||
{
|
||||
$a = error_get_last();
|
||||
if ($a != null && strpos($a['message'], "execution time")) {
|
||||
//writting in partially downloaded file for future reference of user
|
||||
print_r($a);
|
||||
//set session variable to check if there was error while exporting
|
||||
$_SESSION['pma_export_error'] = $a['message'];
|
||||
}
|
||||
$a = error_get_last();
|
||||
if ($a != null && strpos($a['message'], "execution time")) {
|
||||
//write in partially downloaded file for future reference of user
|
||||
print_r($a);
|
||||
//set session variable to check if there was error while exporting
|
||||
$_SESSION['pma_export_error'] = $a['message'];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Detect ob_gzhandler
|
||||
|
||||
14
js/export.js
14
js/export.js
@@ -216,7 +216,7 @@ function toggle_quick_or_custom()
|
||||
var time_out;
|
||||
function check_time_out(time_limit)
|
||||
{
|
||||
//margin of one second to avoid race condition to set/access session variable
|
||||
//margin of one second to avoid race condition to set/access session variable
|
||||
time_limit = time_limit + 1;
|
||||
var href = "export.php";
|
||||
var params = {
|
||||
@@ -227,16 +227,16 @@ function check_time_out(time_limit)
|
||||
clearTimeout(time_out);
|
||||
time_out = setTimeout(function(){
|
||||
$.get(href, params, function (data) {
|
||||
if(data['message'] !== 'success') {
|
||||
if (data['message'] !== 'success') {
|
||||
PMA_ajaxShowMessage(
|
||||
'<div class="error">' +
|
||||
PMA_messages.strTimeOutError +
|
||||
'</div>',
|
||||
false
|
||||
'<div class="error">' +
|
||||
PMA_messages.strTimeOutError +
|
||||
'</div>',
|
||||
false
|
||||
);
|
||||
}
|
||||
});
|
||||
},time_limit*1000);
|
||||
}, time_limit * 1000);
|
||||
|
||||
}
|
||||
AJAX.registerOnload('export.js', function () {
|
||||
|
||||
@@ -413,7 +413,9 @@ $js_messages['strErrorOccurred'] = __(
|
||||
$js_messages['strChangeReportSettings'] = __("Change Report Settings");
|
||||
$js_messages['strShowReportDetails'] = __("Show Report Details");
|
||||
$js_messages['strIgnore'] = __("Ignore");
|
||||
$js_messages['strTimeOutError'] = __("Your export is incomplete, due to a low execution time limit at the PHP level");
|
||||
$js_messages['strTimeOutError'] = __(
|
||||
"Your export is incomplete, due to a low execution time limit at the PHP level"
|
||||
);
|
||||
echo "var PMA_messages = new Array();\n";
|
||||
foreach ($js_messages as $name => $js_message) {
|
||||
PMA_printJsValue("PMA_messages['" . $name . "']", $js_message);
|
||||
|
||||
Reference in New Issue
Block a user