From 5b42185a0384e52dba548eb7c591e45b694f5ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Kaleta?= Date: Thu, 8 Sep 2022 14:42:58 +0200 Subject: [PATCH] Resolved #41 set cache adapter --- .../example1/app/Model/FileStorage/Drivers/DatabaseDriver.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/example1/app/Model/FileStorage/Drivers/DatabaseDriver.php b/examples/example1/app/Model/FileStorage/Drivers/DatabaseDriver.php index fd49b57..be3f460 100644 --- a/examples/example1/app/Model/FileStorage/Drivers/DatabaseDriver.php +++ b/examples/example1/app/Model/FileStorage/Drivers/DatabaseDriver.php @@ -2,6 +2,7 @@ namespace Model\FileStorage\Drivers; +use Dframe\Config\Config; use Dframe\FileStorage\Drivers\DatabaseDriverInterface; use Exception; use Model\Model; @@ -83,8 +84,10 @@ public function cache($adapter, $originalPath, $cachePath, $mime, $stream = fals $cache = $this->db->select('file_cache', '*', ['file_cache_path' => $cachePath])->result(); if (empty($cache['id']) and !empty($row['file_id'])) { + $cacheConfig = Config::load('fileStorage')->get('cache'); $data = [ 'file_id' => $row['file_id'], + 'file_cache_adapter' => $cacheConfig['adapter'], 'file_cache_path' => $cachePath, 'file_cache_mime' => $mime ];