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);