Fix: Increase timeout

This commit is contained in:
Laurent Destailleur 2011-03-05 01:53:20 +00:00
parent d0514c09f9
commit 07d36fac4b

View File

@ -61,9 +61,15 @@ $formfile = new FormFile($db);
print_fiche_titre($langs->trans("Backup"),'','setup'); print_fiche_titre($langs->trans("Backup"),'','setup');
// TODO Define ExecTimeLimit and MemoryLimit $ExecTimeLimit=600;
if (!empty($ExecTimeLimit)) { if (!empty($ExecTimeLimit)) {
@set_time_limit($ExecTimeLimit); // Cette page peut etre longue. On augmente le delai autorise.
// Ne fonctionne que si on est pas en safe_mode.
$err=error_reporting();
error_reporting(0); // Disable all errors
//error_reporting(E_ALL);
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
error_reporting($err);
} }
if (!empty($MemoryLimit)) { if (!empty($MemoryLimit)) {
@ini_set('memory_limit', $MemoryLimit); @ini_set('memory_limit', $MemoryLimit);
@ -181,6 +187,7 @@ if ($what == 'mysql')
$errormsg=$langs->trans("ErrorFailedToWriteInDir"); $errormsg=$langs->trans("ErrorFailedToWriteInDir");
} }
// Get errorstring // Get errorstring
// TODO Scan full file instead of 2048 first char to search for "-- dump completed"
if ($compression == 'none') $handle = fopen($outputfile, 'r'); if ($compression == 'none') $handle = fopen($outputfile, 'r');
if ($compression == 'gz') $handle = gzopen($outputfile, 'r'); if ($compression == 'gz') $handle = gzopen($outputfile, 'r');
if ($compression == 'bz') $handle = bzopen($outputfile, 'r'); if ($compression == 'bz') $handle = bzopen($outputfile, 'r');