aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/BookmarkFileService.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/bookmark/BookmarkFileService.php')
-rw-r--r--application/bookmark/BookmarkFileService.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/application/bookmark/BookmarkFileService.php b/application/bookmark/BookmarkFileService.php
index c9ec2609..1ba00712 100644
--- a/application/bookmark/BookmarkFileService.php
+++ b/application/bookmark/BookmarkFileService.php
@@ -5,6 +5,7 @@ namespace Shaarli\Bookmark;
5 5
6 6
7use Exception; 7use Exception;
8use malkusch\lock\mutex\Mutex;
8use Shaarli\Bookmark\Exception\BookmarkNotFoundException; 9use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
9use Shaarli\Bookmark\Exception\DatastoreNotInitializedException; 10use Shaarli\Bookmark\Exception\DatastoreNotInitializedException;
10use Shaarli\Bookmark\Exception\EmptyDataStoreException; 11use Shaarli\Bookmark\Exception\EmptyDataStoreException;
@@ -47,15 +48,19 @@ class BookmarkFileService implements BookmarkServiceInterface
47 /** @var bool true for logged in users. Default value to retrieve private bookmarks. */ 48 /** @var bool true for logged in users. Default value to retrieve private bookmarks. */
48 protected $isLoggedIn; 49 protected $isLoggedIn;
49 50
51 /** @var Mutex */
52 protected $mutex;
53
50 /** 54 /**
51 * @inheritDoc 55 * @inheritDoc
52 */ 56 */
53 public function __construct(ConfigManager $conf, History $history, $isLoggedIn) 57 public function __construct(ConfigManager $conf, History $history, Mutex $mutex, $isLoggedIn)
54 { 58 {
55 $this->conf = $conf; 59 $this->conf = $conf;
56 $this->history = $history; 60 $this->history = $history;
61 $this->mutex = $mutex;
57 $this->pageCacheManager = new PageCacheManager($this->conf->get('resource.page_cache'), $isLoggedIn); 62 $this->pageCacheManager = new PageCacheManager($this->conf->get('resource.page_cache'), $isLoggedIn);
58 $this->bookmarksIO = new BookmarkIO($this->conf); 63 $this->bookmarksIO = new BookmarkIO($this->conf, $this->mutex);
59 $this->isLoggedIn = $isLoggedIn; 64 $this->isLoggedIn = $isLoggedIn;
60 65
61 if (!$this->isLoggedIn && $this->conf->get('privacy.hide_public_links', false)) { 66 if (!$this->isLoggedIn && $this->conf->get('privacy.hide_public_links', false)) {