'Method not allowed']); exit; } // set the json variable for request validation handling include_once('lib/functions.php'); include_once('lib/html_utility.php'); srv('json', true); $auth_json = true; include_once('include/auth.php'); include_once('install/functions.php'); include_once('lib/installer.php'); include_once('lib/utility.php'); srv('json', true); $auth_json = true; $debug = false; $initialData = []; // ================= input validation ================= gnrv('data', []); if (isrv('data') && gnrv('data')) { log_install_debug('json','Using supplied data'); $initialData = gnrv('data'); if (!is_array($initialData)) { $initialData = [$initialData]; } } $json_level = log_install_level('json',POLLER_VERBOSITY_NONE); log_install_high('json','Start: ' . clean_up_lines(json_encode($initialData))); $initialData = array_merge($initialData, ['Runtime' => 'Web']); if (isset($initialData['step']) && $initialData['step'] == Installer::STEP_TEST_REMOTE) { $json = install_test_remote_database_connection(); $json_debug = $json; } else { $installer = new Installer($initialData); $json = json_encode($installer); $json_debug = $json; if ($json_level < POLLER_VERBOSITY_DEBUG) { $installer->setRuntime('Json'); $json_debug = json_encode($installer); } } $response = json_decode((string) $json, true); if (is_array($response)) { $response['csrfMagicToken'] = csrf_get_tokens(); $encoded_response = json_encode($response); if ($encoded_response !== false) { $json = $encoded_response; } } log_install_high('json',' End: ' . clean_up_lines($json_debug) . PHP_EOL); header('Content-Type: application/json'); header('Cache-Control: no-store'); header('X-Content-Type-Options: nosniff'); header('Content-Length: ' . strlen((string) $json)); print $json;