feat(core,ecommerce,ckeditor5,board,admin_basic): 공개 자산 직접 URL(CDN) 서빙 옵트인
StorageInterface::url 의 public 하드코딩을 완화하고 core.storage.filter_url 훅을 신설해, 완전 공개 자산(상품·카테고리·리뷰·에디터 이미지)의 직접 URL 서빙을 옵트인으로 열었다. 미설정 시 기존 스트리밍 100% 보존. 디스크 결정은 확장 개별 설정 > 코어 전역 > 미설정 순이며, 서빙·삭제·이동은 행에 기록된 disk 를 따라 전환 전후 자산이 혼재해도 각자 실제 저장 위치를 향한다. 고아 disk(공급 플러그인 비활성화)는 스트리밍으로 폴백해 500 이 되지 않는다. 공개 이슈 (@lyg-kaban 건의) 대응.
This commit is contained in:
1 parent
37fad55333
commit
057e002ad1
125 files changed
+5913
-203
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Contracts\Extension;
|
||||
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
/**
|
||||
* 확장(모듈/플러그인) 스토리지 인터페이스
|
||||
*
|
||||
@@ -50,12 +52,14 @@ interface StorageInterface
|
||||
/**
|
||||
* 파일의 공개 URL을 반환합니다.
|
||||
*
|
||||
* public disk인 경우 직접 URL을 반환하고,
|
||||
* private disk인 경우 null을 반환합니다 (별도 API 엔드포인트 사용).
|
||||
* public 디스크이거나 `filesystems.disks.{disk}.url` 이 설정된 디스크(S3+CDN 등)면
|
||||
* 직접 URL 을 반환하고, 그 외에는 null 을 반환합니다 (별도 API 엔드포인트 사용).
|
||||
* 생성 결과는 디스크 종류와 무관하게 `core.storage.filter_url` 필터 훅을 항상 통과하므로,
|
||||
* 확장이 URL 을 공급/수정/차단할 수 있습니다 (null 반환도 훅 발화 대상).
|
||||
*
|
||||
* @param string $category 카테고리
|
||||
* @param string $path 파일 경로
|
||||
* @return string|null 파일 URL (private disk인 경우 null)
|
||||
* @return string|null 파일 URL (직접 URL 불가 디스크이고 훅 공급도 없으면 null)
|
||||
*/
|
||||
public function url(string $category, string $path): ?string;
|
||||
|
||||
@@ -110,9 +114,9 @@ interface StorageInterface
|
||||
* @param string $path 파일 경로
|
||||
* @param string $filename 다운로드 시 표시될 파일명
|
||||
* @param array $headers 추가 HTTP 헤더
|
||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse|null 파일 스트림 (파일이 없으면 null)
|
||||
* @return StreamedResponse|null 파일 스트림 (파일이 없으면 null)
|
||||
*/
|
||||
public function response(string $category, string $path, string $filename, array $headers = []): ?\Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
public function response(string $category, string $path, string $filename, array $headers = []): ?StreamedResponse;
|
||||
|
||||
/**
|
||||
* 사용할 디스크를 변경한 새 인스턴스를 반환합니다.
|
||||
@@ -132,7 +136,7 @@ interface StorageInterface
|
||||
* @param string $path 파일 경로
|
||||
* @param string $filename 다운로드 시 표시될 파일명
|
||||
* @param array $headers 추가 HTTP 헤더
|
||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse|null 다운로드 응답 (파일이 없으면 null)
|
||||
* @return StreamedResponse|null 다운로드 응답 (파일이 없으면 null)
|
||||
*/
|
||||
public function download(string $category, string $path, string $filename, array $headers = []): ?\Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
public function download(string $category, string $path, string $filename, array $headers = []): ?StreamedResponse;
|
||||
}
|
||||
Reference in new issue
Block a user