v7.0.0 release
This commit is contained in:
1 parent
0e7fa04b03
commit
c4ea9a6cd1
3582 files changed
+626189
-160151
No files matched your search
@@ -137,6 +137,21 @@ class ValidationApi
|
||||
throw new Exception(lang('error_db_credentials_required'));
|
||||
}
|
||||
|
||||
// DB 테이블 접두사 길이 검증 (Write DB 입력에만 적용)
|
||||
// 접두사가 길면 자동 생성 인덱스명이 MySQL identifier 한도(64자)를 초과해
|
||||
// 일부 확장 설치 시 마이그레이션이 실패하므로 연결 시도 전에 차단한다.
|
||||
if (! $isReadDb) {
|
||||
$tablePrefix = (string) ($input['db_prefix'] ?? '');
|
||||
if (strlen($tablePrefix) > MAX_DB_PREFIX_LENGTH) {
|
||||
throw new Exception(
|
||||
lang('error_db_prefix_too_long', [
|
||||
'max' => MAX_DB_PREFIX_LENGTH,
|
||||
'current' => strlen($tablePrefix),
|
||||
])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 데이터베이스 연결 시도
|
||||
$pdo = getDatabaseConnection($config, $isReadDb);
|
||||
|
||||
@@ -162,12 +177,12 @@ class ValidationApi
|
||||
$message = lang('success_db_write_connected');
|
||||
}
|
||||
|
||||
// 기존 테이블 감지 (Write DB만 수행 — 이슈 #244 대응)
|
||||
// 기존 테이블 감지 (Write DB만 수행)
|
||||
// 사용자가 입력한 db_prefix를 g7 시그니처에 적용하여 정확히 비교
|
||||
$existingTables = null;
|
||||
if (!$isReadDb) {
|
||||
$tablePrefix = (string) ($input['db_prefix'] ?? 'g7_');
|
||||
$existingTables = checkExistingTables($pdo, $database, $tablePrefix);
|
||||
$detectPrefix = ($input['db_prefix'] ?? '') !== '' ? (string) $input['db_prefix'] : 'g7_';
|
||||
$existingTables = checkExistingTables($pdo, $database, $detectPrefix);
|
||||
}
|
||||
|
||||
// 성공 응답
|
||||
|
||||
@@ -73,7 +73,7 @@ class StateManagementApi
|
||||
// state.json 파일 실제 존재 여부 (getInstallationState는 부재 시 DEFAULT_INSTALLATION_STATE를 반환하므로
|
||||
// isset($state['installation_status']) 로는 "기본 상태"와 "실제 파일 상태"를 구분할 수 없다)
|
||||
$stateFileExists = file_exists(STATE_PATH);
|
||||
$installedFlagPath = BASE_PATH . '/storage/app/g7_installed';
|
||||
$installedFlagPath = BASE_PATH.'/storage/app/g7_installed';
|
||||
|
||||
// 현재 설치 상태 조회
|
||||
$state = getInstallationState();
|
||||
@@ -81,7 +81,7 @@ class StateManagementApi
|
||||
// installation_status 값을 status로 매핑
|
||||
$status = 'pending';
|
||||
|
||||
if (!$stateFileExists && file_exists($installedFlagPath)) {
|
||||
if (! $stateFileExists && file_exists($installedFlagPath)) {
|
||||
// state.json 삭제 + g7_installed 플래그 존재 → 설치 완료 후 정리된 상태
|
||||
// 폴링이 완료 시점을 놓치면 이후 주기에서 이 분기로 completed 전환
|
||||
$status = 'completed';
|
||||
@@ -189,7 +189,7 @@ class StateManagementApi
|
||||
// 상태 저장
|
||||
$saved = saveInstallationState($state);
|
||||
|
||||
if (!$saved) {
|
||||
if (! $saved) {
|
||||
throw new Exception(lang('state_save_failed'));
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ class StateManagementApi
|
||||
$state['abort_reason'] = 'User requested';
|
||||
|
||||
// 롤백 실패 정보 저장 (새로고침 후에도 표시용)
|
||||
if (isset($rollbackResult['success']) && !$rollbackResult['success']) {
|
||||
if (isset($rollbackResult['success']) && ! $rollbackResult['success']) {
|
||||
$state['rollback_failure'] = [
|
||||
'task' => $rollbackResult['task'] ?? null,
|
||||
'message' => $rollbackResult['message'] ?? null,
|
||||
@@ -356,6 +356,17 @@ require_once __DIR__.'/../includes/installer-state.php';
|
||||
// 롤백 함수 로드 (reset, abort 액션에서 필요)
|
||||
require_once __DIR__.'/rollback-functions.php';
|
||||
|
||||
// 설치 완료 후 진입 차단 (KVE-2026-1056)
|
||||
// finalize 전용 가드 — `.env` 의 INSTALLER_COMPLETED=true 단독으로만 차단한다.
|
||||
// 일반 가드(installer_guard_or_410)는 `g7_installed` 락 파일도 차단 사유로 삼는데,
|
||||
// 그 락 파일은 마지막 task `complete_flag` 가 먼저 생성한다. 그 직후에도 본 엔드포인트의
|
||||
// action=get 폴링(1초 간격)이 계속되어 `completed` 상태를 받아야 완료 화면으로 전환되므로,
|
||||
// 락 파일 기준으로 차단하면 정상 설치가 "진행 중"에 고착되는 자가 차단 회귀가 발생한다.
|
||||
// 완전 완료 신호인 `.env` 플래그를 기준으로 삼아 get/reset/abort 를
|
||||
// 일괄 차단하면서 폴링 구간은 비파괴로 통과시킨다.
|
||||
require_once __DIR__.'/_guard.php';
|
||||
installer_guard_finalize_or_410();
|
||||
|
||||
// 다국어 로드
|
||||
$currentLang = getCurrentLanguage();
|
||||
$translations = loadTranslations($currentLang);
|
||||
|
||||
Reference in new issue
Block a user