Translated using Weblate (Turkish)
[phpmyadmin.git] / import_status.php
blob9ca0e6fd847c989b5b942d09546fa8706627892d
1 <?php
2 /**
3 * Import progress bar backend
5 * @package PhpMyAdmin
6 */
7 declare(strict_types=1);
9 use PhpMyAdmin\Core;
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';
19 list(
20 $SESSION_KEY,
21 $upload_id,
22 $plugins
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
36 usleep(300000);
38 $maximumTime = ini_get('max_execution_time');
39 $timestamp = time();
40 // wait until message is available
41 while ($_SESSION['Import_message']['message'] == null) {
42 // close session before sleeping
43 session_write_close();
44 // sleep
45 usleep(250000); // 0.25 sec
46 // reopen session
47 session_start();
49 if ((time() - $timestamp) > $maximumTime) {
50 $_SESSION['Import_message']['message'] = PhpMyAdmin\Message::error(
51 __('Could not load the progress of the import.')
52 )->getDisplay();
53 break;
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'],
63 ]);
64 } else {
65 ImportAjax::status($_GET["id"]);