aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/BookmarkIO.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-08-01 11:10:57 +0200
committerArthurHoaro <arthur@hoa.ro>2020-08-01 11:10:57 +0200
commitd6e5f04d3987e498c5cb859eed6bff33d67949df (patch)
treeaec901679761a9bb4dfdbecc6625e4f4583d004e /application/bookmark/BookmarkIO.php
parentf7f08ceec1b218e1525153e8bd3d0199f2fb1c9d (diff)
downloadShaarli-d6e5f04d3987e498c5cb859eed6bff33d67949df.tar.gz
Shaarli-d6e5f04d3987e498c5cb859eed6bff33d67949df.tar.zst
Shaarli-d6e5f04d3987e498c5cb859eed6bff33d67949df.zip
Remove anonymous permission and initialize bookmarks on login
Diffstat (limited to 'application/bookmark/BookmarkIO.php')
-rw-r--r--application/bookmark/BookmarkIO.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/application/bookmark/BookmarkIO.php b/application/bookmark/BookmarkIO.php
index 1026e2f9..6bf7f365 100644
--- a/application/bookmark/BookmarkIO.php
+++ b/application/bookmark/BookmarkIO.php
@@ -2,6 +2,7 @@
2 2
3namespace Shaarli\Bookmark; 3namespace Shaarli\Bookmark;
4 4
5use Shaarli\Bookmark\Exception\DatastoreNotInitializedException;
5use Shaarli\Bookmark\Exception\EmptyDataStoreException; 6use Shaarli\Bookmark\Exception\EmptyDataStoreException;
6use Shaarli\Bookmark\Exception\NotWritableDataStoreException; 7use Shaarli\Bookmark\Exception\NotWritableDataStoreException;
7use Shaarli\Config\ConfigManager; 8use Shaarli\Config\ConfigManager;
@@ -52,13 +53,14 @@ class BookmarkIO
52 * 53 *
53 * @return BookmarkArray instance 54 * @return BookmarkArray instance
54 * 55 *
55 * @throws NotWritableDataStoreException Data couldn't be loaded 56 * @throws NotWritableDataStoreException Data couldn't be loaded
56 * @throws EmptyDataStoreException Datastore doesn't exist 57 * @throws EmptyDataStoreException Datastore file exists but does not contain any bookmark
58 * @throws DatastoreNotInitializedException File does not exists
57 */ 59 */
58 public function read() 60 public function read()
59 { 61 {
60 if (! file_exists($this->datastore)) { 62 if (! file_exists($this->datastore)) {
61 throw new EmptyDataStoreException(); 63 throw new DatastoreNotInitializedException();
62 } 64 }
63 65
64 if (!is_writable($this->datastore)) { 66 if (!is_writable($this->datastore)) {