diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-05-14 08:53:35 +0300 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-05-14 08:53:35 +0300 |
commit | 1c2e8246970f9b610222f09f06a7da03d1817433 (patch) | |
tree | ec7b924e16a1ae83917e52270affff8b60a4b7a2 /import_status.php | |
parent | 5ba5024b4c24ec1401f02fb1a1051f5c69838958 (diff) |
bug #4903 & bug #4367 Import status infinite loop
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'import_status.php')
-rw-r--r-- | import_status.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/import_status.php b/import_status.php index 2a638eec10..c4b442f456 100644 --- a/import_status.php +++ b/import_status.php @@ -51,6 +51,7 @@ if (version_compare(PHP_VERSION, '5.4.0', '>=') define('PMA_MINIMUM_COMMON', 1); require_once 'libraries/common.inc.php'; +require_once 'libraries/Util.class.php'; require_once 'libraries/display_import_ajax.lib.php'; /* @@ -86,9 +87,23 @@ if (isset($_GET["message"]) && $_GET["message"]) { // which is set inside import.php usleep(300000); + $maximumTime = ini_get('max_execution_time'); + $timestamp = time(); // wait until message is available while ($_SESSION['Import_message']['message'] == null) { + // close session before sleeping + session_write_close(); + // sleep usleep(250000); // 0.25 sec + // reopen session + session_start(); + + if ((time() - $timestamp) > $maximumTime) { + $_SESSION['Import_message']['message'] = PMA_Message::error( + __('Could not load the progress of the import.') + )->getDisplay(); + break; + } } echo $_SESSION['Import_message']['message']; |