diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-01-23 21:13:41 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-23 21:19:21 +0200 |
commit | b0428aa9b02b058b72c40b6e8dc2298d55bf692f (patch) | |
tree | c57176b24d76836a73608fb273b1094fcb8de785 /application/bookmark/BookmarkFileService.php | |
parent | 485b168a9677d160b0c0426e4f282b9bd0c632c1 (diff) | |
download | Shaarli-b0428aa9b02b058b72c40b6e8dc2298d55bf692f.tar.gz Shaarli-b0428aa9b02b058b72c40b6e8dc2298d55bf692f.tar.zst Shaarli-b0428aa9b02b058b72c40b6e8dc2298d55bf692f.zip |
Migrate cache purge function to a proper class
And update dependencies and tests.
Note that SESSION['tags'] has been removed a log ago
Diffstat (limited to 'application/bookmark/BookmarkFileService.php')
-rw-r--r-- | application/bookmark/BookmarkFileService.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/application/bookmark/BookmarkFileService.php b/application/bookmark/BookmarkFileService.php index 9c59e139..fef998fd 100644 --- a/application/bookmark/BookmarkFileService.php +++ b/application/bookmark/BookmarkFileService.php | |||
@@ -12,6 +12,7 @@ use Shaarli\Formatter\BookmarkMarkdownFormatter; | |||
12 | use Shaarli\History; | 12 | use Shaarli\History; |
13 | use Shaarli\Legacy\LegacyLinkDB; | 13 | use Shaarli\Legacy\LegacyLinkDB; |
14 | use Shaarli\Legacy\LegacyUpdater; | 14 | use Shaarli\Legacy\LegacyUpdater; |
15 | use Shaarli\Render\PageCacheManager; | ||
15 | use Shaarli\Updater\UpdaterUtils; | 16 | use Shaarli\Updater\UpdaterUtils; |
16 | 17 | ||
17 | /** | 18 | /** |
@@ -39,6 +40,9 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
39 | /** @var History instance */ | 40 | /** @var History instance */ |
40 | protected $history; | 41 | protected $history; |
41 | 42 | ||
43 | /** @var PageCacheManager instance */ | ||
44 | protected $pageCacheManager; | ||
45 | |||
42 | /** @var bool true for logged in users. Default value to retrieve private bookmarks. */ | 46 | /** @var bool true for logged in users. Default value to retrieve private bookmarks. */ |
43 | protected $isLoggedIn; | 47 | protected $isLoggedIn; |
44 | 48 | ||
@@ -49,6 +53,7 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
49 | { | 53 | { |
50 | $this->conf = $conf; | 54 | $this->conf = $conf; |
51 | $this->history = $history; | 55 | $this->history = $history; |
56 | $this->pageCacheManager = new PageCacheManager($this->conf->get('resource.page_cache')); | ||
52 | $this->bookmarksIO = new BookmarkIO($this->conf); | 57 | $this->bookmarksIO = new BookmarkIO($this->conf); |
53 | $this->isLoggedIn = $isLoggedIn; | 58 | $this->isLoggedIn = $isLoggedIn; |
54 | 59 | ||
@@ -275,7 +280,7 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
275 | } | 280 | } |
276 | $this->bookmarks->reorder(); | 281 | $this->bookmarks->reorder(); |
277 | $this->bookmarksIO->write($this->bookmarks); | 282 | $this->bookmarksIO->write($this->bookmarks); |
278 | invalidateCaches($this->conf->get('resource.page_cache')); | 283 | $this->pageCacheManager->invalidateCaches(); |
279 | } | 284 | } |
280 | 285 | ||
281 | /** | 286 | /** |