Translated using Weblate (Chinese (Simplified))
[phpmyadmin.git] / js / whitelist.php
blobc314b9e260cc58d8aa82111f1d2bacfdbf8cdbe6
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Exporting of Core::$goto_whitelist from PHP to Javascript
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Core;
11 use PhpMyAdmin\OutputBuffering;
13 if (! defined('ROOT_PATH')) {
14 define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
17 if (! defined('TESTSUITE')) {
18 chdir('..');
20 // Send correct type:
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();
37 $buffer->start();
38 if (! defined('TESTSUITE')) {
39 register_shutdown_function(
40 function () {
41 echo OutputBuffering::getInstance()->getContents();
46 echo "var GotoWhitelist = [];\n";
47 $i = 0;
48 foreach (Core::$goto_whitelist as $one_whitelist) {
49 echo 'GotoWhitelist[' , $i , '] = \'' , $one_whitelist , '\';' , "\n";
50 $i++;