From 912f697cff2476ea5b734268f56759c1093daeb4 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 24 Dec 2015 14:30:20 -0800 Subject: [PATCH] Give ZipBackup a larger timeout when possible (10mins) --- system/src/Grav/Common/Backup/ZipBackup.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/src/Grav/Common/Backup/ZipBackup.php b/system/src/Grav/Common/Backup/ZipBackup.php index c73358e9d..cf3689b28 100644 --- a/system/src/Grav/Common/Backup/ZipBackup.php +++ b/system/src/Grav/Common/Backup/ZipBackup.php @@ -64,6 +64,8 @@ class ZipBackup $zip = new \ZipArchive(); $zip->open($destination, \ZipArchive::CREATE); + $max_execution_time = ini_set('max_execution_time', 600); + static::folderToZip(GRAV_ROOT, $zip, strlen(rtrim(GRAV_ROOT, DS) . DS), $messager); $messager && $messager([ @@ -85,6 +87,10 @@ class ZipBackup $zip->close(); + if ($max_execution_time !== false) { + ini_set('max_execution_time', $max_execution_time); + } + return $destination; }