Skip to content

Commit

Permalink
Remove TESTSUITE constant from js/messages.php
Browse files Browse the repository at this point in the history
Related to #15247

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Jul 6, 2020
1 parent 22fe838 commit a7be49f
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions js/messages.php
Expand Up @@ -13,36 +13,29 @@
// phpcs:enable
}

if (! defined('TESTSUITE')) {
chdir('..');
chdir('..');

// Send correct type:
header('Content-Type: text/javascript; charset=UTF-8');
// Send correct type.
header('Content-Type: text/javascript; charset=UTF-8');

// Cache output in client - the nocache query parameter makes sure that this
// file is reloaded when config changes
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
// Cache output in client - the nocache query parameter makes sure that this file is reloaded when config changes.
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');

// Avoid loading the full common.inc.php because this would add many
// non-js-compatible stuff like DOCTYPE
// phpcs:disable PSR1.Files.SideEffects
define('PMA_MINIMUM_COMMON', true);
define('PMA_PATH_TO_BASEDIR', '../');
define('PMA_NO_SESSION', true);
// phpcs:enable
// Avoid loading the full common.inc.php because this would add many non-js-compatible stuff like DOCTYPE.
// phpcs:disable PSR1.Files.SideEffects
define('PMA_MINIMUM_COMMON', true);
define('PMA_PATH_TO_BASEDIR', '../');
define('PMA_NO_SESSION', true);
// phpcs:enable

require_once ROOT_PATH . 'libraries/common.inc.php';
}
require_once ROOT_PATH . 'libraries/common.inc.php';

$buffer = OutputBuffering::getInstance();
$buffer->start();
if (! defined('TESTSUITE')) {
register_shutdown_function(
static function () {
echo OutputBuffering::getInstance()->getContents();
}
);
}

register_shutdown_function(static function () {
echo OutputBuffering::getInstance()->getContents();
});

/** @var JavaScriptMessagesController $controller */
$controller = $containerBuilder->get(JavaScriptMessagesController::class);
Expand Down

0 comments on commit a7be49f

Please sign in to comment.