From 68cd61d86e45978d40b04587efdeb8c804c8939c Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 22 May 2024 16:47:20 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20file=5Fcache=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Global/GetCachedMap.php | 6 +++++- hwe/sammo/API/Global/GetConst.php | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hwe/sammo/API/Global/GetCachedMap.php b/hwe/sammo/API/Global/GetCachedMap.php index fff67442..c93aa26c 100644 --- a/hwe/sammo/API/Global/GetCachedMap.php +++ b/hwe/sammo/API/Global/GetCachedMap.php @@ -55,7 +55,11 @@ class GetCachedMap extends \sammo\BaseAPI return 'cache 불가'; } - $storage = new \Nette\Caching\Storages\FileStorage('data/file_cache'); + $absolutePath = realpath('data/file_cache'); + if (!$absolutePath) { + return 'cache 불가'; + } + $storage = new \Nette\Caching\Storages\FileStorage($absolutePath); $cache = new Cache($storage); $now = TimeUtil::nowDateTimeImmutable(); diff --git a/hwe/sammo/API/Global/GetConst.php b/hwe/sammo/API/Global/GetConst.php index ce4f0f73..b8693992 100644 --- a/hwe/sammo/API/Global/GetConst.php +++ b/hwe/sammo/API/Global/GetConst.php @@ -288,6 +288,10 @@ class GetConst extends \sammo\BaseAPI if (!prepareDir($cacheDir)) { throw new RuntimeException('cache 폴더 없음'); } + $absolutePath = realpath($cacheDir); + if (!$absolutePath) { + throw new RuntimeException('cache 폴더 없음'); + } $storage = new \Nette\Caching\Storages\FileStorage($cacheDir); $cache = new Cache($storage);