3 * Import progress bar backend
7 declare(strict_types
=1);
10 use PhpMyAdmin\Display\ImportAjax
;
12 if (! defined('ROOT_PATH')) {
13 define('ROOT_PATH', __DIR__
. DIRECTORY_SEPARATOR
);
16 define('PMA_MINIMUM_COMMON', 1);
18 require_once ROOT_PATH
. 'libraries/common.inc.php';
23 ) = ImportAjax
::uploadProgressSetup();
25 global $containerBuilder;
27 // $_GET["message"] is used for asking for an import message
28 if (isset($_GET["message"]) && $_GET["message"]) {
29 // AJAX requests can't be cached!
30 Core
::noCacheHeader();
32 header('Content-type: text/html');
34 // wait 0.3 sec before we check for $_SESSION variable,
35 // which is set inside libraries/entry_points/import.php
38 $maximumTime = ini_get('max_execution_time');
40 // wait until message is available
41 while ($_SESSION['Import_message']['message'] == null) {
42 // close session before sleeping
43 session_write_close();
45 usleep(250000); // 0.25 sec
49 if ((time() - $timestamp) > $maximumTime) {
50 $_SESSION['Import_message']['message'] = PhpMyAdmin\Message
::error(
51 __('Could not load the progress of the import.')
57 echo $_SESSION['Import_message']['message'];
59 $template = $containerBuilder->get('template');
61 echo $template->render('import_status', [
62 'go_back_url' => $_SESSION['Import_message']['go_back_url'],
65 ImportAjax
::status($_GET["id"]);