v7.0.0 release
This commit is contained in:
1 parent
0e7fa04b03
commit
c4ea9a6cd1
3582 files changed
+626189
-160151
No files matched your search
@@ -17,7 +17,8 @@ use Illuminate\Support\Facades\Log;
|
||||
*
|
||||
* 버전 포함 캐시 (layout.{identifier}.{name}.v{version})는
|
||||
* incrementExtensionCacheVersion() + TTL로 무효화됩니다.
|
||||
* 레이아웃 내용 편집 시에만 현재 버전 키를 능동 삭제합니다.
|
||||
* 레이아웃 내용 편집 시에만 현재 버전 키를 능동 삭제합니다 — 일반 응답 키와
|
||||
* 레이아웃 편집기 응답 키(`.meta` 접미사, `with_source_meta=1`) 두 가지 모두.
|
||||
*
|
||||
* 이 Trait를 사용하는 클래스는 반드시 다음 속성/메서드를 제공해야 합니다:
|
||||
* - $layoutRepository: LayoutRepositoryInterface 인스턴스
|
||||
@@ -105,24 +106,32 @@ trait InvalidatesLayoutCache
|
||||
$cache->forget("template.{$layout->template_id}.layout.{$layout->name}.{$sourceHash}");
|
||||
}
|
||||
|
||||
// 3. PublicLayoutController 캐시 (버전 포함)
|
||||
// 레이아웃 내용 편집 시 현재 버전 키 삭제 (버전 변경 없이 내용만 바뀜)
|
||||
// 3. PublicLayoutController 캐시 (버전 포함) — 일반 응답 + 편집기(`.meta`) 응답 두 키 모두.
|
||||
// PublicLayoutController::serve() 가 `with_source_meta=1`(레이아웃 편집기) 응답을 `.meta`
|
||||
// 접미사 별도 키로 캐싱하므로, 그 키를 함께 삭제하지 않으면 템플릿/레이아웃 상태 변화
|
||||
// (refresh-layout / activate / deactivate / uninstall 등) 후에도 편집기가 stale 캐시를
|
||||
// 받는다. 레이아웃
|
||||
// 저장 경로(LayoutService::clearPublicServingCache)는 이미 두 키를 지우므로 정합을 맞춘다.
|
||||
if ($templateIdentifier) {
|
||||
$cacheVersion = (int) $cache->get('ext.cache_version', 0);
|
||||
$cache->forget("layout.{$templateIdentifier}.{$layout->name}.v{$cacheVersion}");
|
||||
$cache->forget("layout.{$templateIdentifier}.{$layout->name}.v{$cacheVersion}.meta");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CacheInterface 인스턴스를 lazy 조회합니다.
|
||||
* 레이아웃 캐시 무효화에 사용할 코어 캐시 드라이버를 반환합니다.
|
||||
*
|
||||
* 레이아웃 캐시 키(`template.*.layout.*`, `layout.*` 등)는 모두 코어 소유
|
||||
* 키이므로 항상 `g7:core:` 접두사 네임스페이스에서 저장/삭제되어야 한다.
|
||||
* 따라서 컨테이너의 `CacheInterface` 바인딩(모듈/플러그인 테스트가 일시적으로
|
||||
* `PluginCacheDriver` 등으로 재바인딩할 수 있음)에 의존하지 않고 항상
|
||||
* CoreCacheDriver 를 직접 생성한다. 의존 시 누수된 바인딩 때문에
|
||||
* `g7:plugin.*` 네임스페이스로 forget 이 빗나가 캐시가 실제로 삭제되지 않는다.
|
||||
*/
|
||||
private function resolveLayoutCache(): CacheInterface
|
||||
{
|
||||
try {
|
||||
return app(CacheInterface::class);
|
||||
} catch (\Throwable $e) {
|
||||
return new CoreCacheDriver(config('cache.default', 'array'));
|
||||
}
|
||||
return new CoreCacheDriver(config('cache.default', 'array'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user