chore(payment): NHN KCP와 NICE 결제 플러그인 개발 브랜치 분리
정식 develop에서는 기본 번들 정책에 따라 제거된 결제 플러그인을 별도 개발 브랜치에서 계속 유지보수할 수 있도록 복원한다.
This commit is contained in:
1 parent
49b21e788c
commit
657f546efc
651 files changed
+49118
-20476
No files matched your search
@@ -6,8 +6,11 @@
|
||||
* SSE/폴링 듀얼 모드 지원을 위한 진행 상황 보고 인터페이스.
|
||||
* - SseEmitter: 실시간 SSE 스트리밍 + addLog
|
||||
* - NullEmitter: addLog만 수행 (폴링 모드, state.json 기반 조회)
|
||||
*
|
||||
* @package G7\Installer
|
||||
*/
|
||||
if (! defined('BASE_PATH')) {
|
||||
|
||||
if (!defined('BASE_PATH')) {
|
||||
define('BASE_PATH', realpath(dirname(__DIR__, 3)) ?: dirname(__DIR__, 3));
|
||||
}
|
||||
|
||||
@@ -16,8 +19,8 @@ interface ProgressEmitter
|
||||
/**
|
||||
* 임의 이벤트 송출 (SSE 이벤트 타입과 데이터 배열).
|
||||
*
|
||||
* @param string $event 이벤트 타입 (connected, task_start, task_complete, log, completed, error, aborted, rollback_failed)
|
||||
* @param array $data 이벤트 데이터
|
||||
* @param string $event 이벤트 타입 (connected, task_start, task_complete, log, completed, error, aborted, rollback_failed)
|
||||
* @param array $data 이벤트 데이터
|
||||
*/
|
||||
public function emit(string $event, array $data): void;
|
||||
|
||||
@@ -54,22 +57,8 @@ class SseEmitter implements ProgressEmitter
|
||||
|
||||
public function emit(string $event, array $data): void
|
||||
{
|
||||
// SSE data 라인은 항상 유효 JSON 이어야 한다 (gnuboard/g7#62).
|
||||
// composer install 등 외부 프로세스 로그에 invalid UTF-8 바이트가 섞이면
|
||||
// json_encode 가 false 를 반환해 "data: \n\n" (빈 값) 이 송출되고,
|
||||
// 프론트 EventSource 리스너의 JSON.parse(e.data) 가 throw 되어 로그 이벤트가 유실된다.
|
||||
// 폴링 응답(state-management)과 동일하게 JSON_INVALID_UTF8_SUBSTITUTE 로 치환하고
|
||||
// false 를 가드한다. (task-runner 의 스트림 scrub 과 이중 안전망)
|
||||
$payload = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE);
|
||||
if ($payload === false) {
|
||||
$payload = json_encode(
|
||||
['message' => '(log line dropped: encoding error)'],
|
||||
JSON_UNESCAPED_UNICODE
|
||||
);
|
||||
}
|
||||
|
||||
echo "event: {$event}\n";
|
||||
echo 'data: '.$payload."\n\n";
|
||||
echo "data: " . json_encode($data, JSON_UNESCAPED_UNICODE) . "\n\n";
|
||||
if (ob_get_level()) {
|
||||
@ob_flush();
|
||||
}
|
||||
@@ -206,10 +195,9 @@ class NullEmitter implements ProgressEmitter
|
||||
*/
|
||||
function getProgressEmitter(): ProgressEmitter
|
||||
{
|
||||
if (! isset($GLOBALS['g7_progress_emitter']) || ! ($GLOBALS['g7_progress_emitter'] instanceof ProgressEmitter)) {
|
||||
$GLOBALS['g7_progress_emitter'] = new SseEmitter;
|
||||
if (!isset($GLOBALS['g7_progress_emitter']) || !($GLOBALS['g7_progress_emitter'] instanceof ProgressEmitter)) {
|
||||
$GLOBALS['g7_progress_emitter'] = new SseEmitter();
|
||||
}
|
||||
|
||||
return $GLOBALS['g7_progress_emitter'];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user