Add a ChangeLog entry for #14773
[phpmyadmin.git] / js / messages.php
bloba99463b7da65e7669e03d5e02263f07f5c9a6f93
1 <?php
3 declare(strict_types=1);
5 use PhpMyAdmin\Controllers\JavaScriptMessagesController;
6 use PhpMyAdmin\OutputBuffering;
8 global $containerBuilder;
10 if (! defined('ROOT_PATH')) {
11 // phpcs:disable PSR1.Files.SideEffects
12 define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
13 // phpcs:enable
16 chdir('..');
18 // Send correct type.
19 header('Content-Type: text/javascript; charset=UTF-8');
21 // Cache output in client - the nocache query parameter makes sure that this file is reloaded when config changes.
22 header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
24 // Avoid loading the full common.inc.php because this would add many non-js-compatible stuff like DOCTYPE.
25 // phpcs:disable PSR1.Files.SideEffects
26 define('PMA_MINIMUM_COMMON', true);
27 define('PMA_PATH_TO_BASEDIR', '../');
28 define('PMA_NO_SESSION', true);
29 // phpcs:enable
31 require_once ROOT_PATH . 'libraries/common.inc.php';
33 $buffer = OutputBuffering::getInstance();
34 $buffer->start();
36 register_shutdown_function(static function () {
37 echo OutputBuffering::getInstance()->getContents();
38 });
40 /** @var JavaScriptMessagesController $controller */
41 $controller = $containerBuilder->get(JavaScriptMessagesController::class);
42 $controller->index();