2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Exporting of Core::$goto_whitelist from PHP to Javascript
8 declare(strict_types
=1);
11 use PhpMyAdmin\OutputBuffering
;
13 if (! defined('ROOT_PATH')) {
14 define('ROOT_PATH', dirname(__DIR__
) . DIRECTORY_SEPARATOR
);
17 if (! defined('TESTSUITE')) {
21 header('Content-Type: text/javascript; charset=UTF-8');
23 // Cache output in client - the nocache query parameter makes sure that this
24 // file is reloaded when config changes
25 header('Expires: ' . gmdate('D, d M Y H:i:s', time() +
3600) . ' GMT');
27 // Avoid loading the full common.inc.php because this would add many
28 // non-js-compatible stuff like DOCTYPE
29 define('PMA_MINIMUM_COMMON', true);
30 define('PMA_PATH_TO_BASEDIR', '../');
31 require_once ROOT_PATH
. 'libraries/common.inc.php';
32 // Close session early as we won't write anything there
33 session_write_close();
36 $buffer = OutputBuffering
::getInstance();
38 if (! defined('TESTSUITE')) {
39 register_shutdown_function(
41 echo OutputBuffering
::getInstance()->getContents();
46 echo "var GotoWhitelist = [];\n";
48 foreach (Core
::$goto_whitelist as $one_whitelist) {
49 echo 'GotoWhitelist[' , $i , '] = \'' , $one_whitelist , '\';' , "\n";