<?php
session_start();

header('Content-Type: application/json; charset=UTF-8');

if (empty($_SESSION['install_finalize_payload']) || !is_array($_SESSION['install_finalize_payload'])) {
    echo json_encode([
        'success' => false,
        'title' => '安装会话不存在',
        'message' => '当前安装会话已失效，请返回上一步重新安装。',
    ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
    exit;
}

unset($_SESSION['install_runtime_probe_passed']);

define('BTBLOG_BOOTSTRAP_PROBE', true);
require_once dirname(__DIR__) . '/common/bootstrap.php';

$_SESSION['install_runtime_probe_passed'] = 1;

echo json_encode([
    'success' => true,
    'title' => '核心加载成功',
    'message' => '当前 Web 运行环境已成功加载加密后的核心文件。',
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
