Translated using Weblate (Lithuanian)
[phpmyadmin.git] / js / messages.php
blob927226b2e88776b44ccfbceedeac03be4d55885d
1 <?php
3 declare(strict_types=1);
5 use PhpMyAdmin\Common;
6 use PhpMyAdmin\Controllers\JavaScriptMessagesController;
7 use PhpMyAdmin\OutputBuffering;
9 /** @psalm-suppress InvalidGlobal */
10 global $containerBuilder;
12 if (! defined('ROOT_PATH')) {
13 // phpcs:disable PSR1.Files.SideEffects
14 define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
15 // phpcs:enable
18 if (PHP_VERSION_ID < 70205) {
19 die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
22 // phpcs:disable PSR1.Files.SideEffects
23 define('PHPMYADMIN', true);
24 // phpcs:enable
26 require_once ROOT_PATH . 'libraries/constants.php';
28 /**
29 * Activate autoloader
31 if (! @is_readable(AUTOLOAD_FILE)) {
32 die(
33 '<p>File <samp>' . AUTOLOAD_FILE . '</samp> missing or not readable.</p>'
34 . '<p>Most likely you did not run Composer to '
35 . '<a href="https://docs.phpmyadmin.net/en/latest/setup.html#installing-from-git">'
36 . 'install library files</a>.</p>'
40 require AUTOLOAD_FILE;
42 chdir('..');
44 // Send correct type.
45 header('Content-Type: text/javascript; charset=UTF-8');
47 // Cache output in client - the nocache query parameter makes sure that this file is reloaded when config changes.
48 header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
50 $isMinimumCommon = true;
51 // phpcs:disable PSR1.Files.SideEffects
52 define('PMA_PATH_TO_BASEDIR', '../');
53 define('PMA_NO_SESSION', true);
54 // phpcs:enable
56 Common::run();
58 $buffer = OutputBuffering::getInstance();
59 $buffer->start();
61 register_shutdown_function(static function (): void {
62 echo OutputBuffering::getInstance()->getContents();
63 });
65 /** @var JavaScriptMessagesController $controller */
66 $controller = $containerBuilder->get(JavaScriptMessagesController::class);
67 $controller();