$urlStep, 'current' => $currentStep ]), INSTALLER_BASE_URL . '/' ); } // 같은 경우에도 깔끔한 URL로 리다이렉트 header('Location: ' . INSTALLER_BASE_URL . '/'); exit; } $state = getInstallationState(); $errors = []; $formData = []; $error = null; // Step 3 기본값 설정 if ($currentStep === 3) { $defaults = DEFAULT_INSTALL_CONFIG; $defaults['app_url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; $defaults['admin_language'] = getCurrentLanguage(); // state.json에서 비밀번호 제외된 config 복원 (세션에서 비밀번호를 사전 입력하지 않음) $savedConfig = $state['config'] ?? $defaults; unset($savedConfig['db_write_password'], $savedConfig['db_read_password']); $formData = array_merge($defaults, $savedConfig); } // 설치 흐름 검증 validateInstallationFlow($currentStep, $state); // POST 요청 처리 if ($_SERVER['REQUEST_METHOD'] === 'POST') { handlePostRequest($currentStep, $currentLang, $formData, $errors, $error); } // 번역 로드 if (!isset($translations)) { $translations = loadTranslations($currentLang); } // Step 범위 체크 (0: welcome ~ 6: complete) if ($currentStep < 0 || $currentStep > 6) { $currentStep = 0; } $stepFile = __DIR__ . '/views/' . $currentStep . '-' . (STEP_FILE_MAP[$currentStep] ?? 'welcome') . '.php'; ?>