]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/bookmark/BookmarkIO.php
Remove anonymous permission and initialize bookmarks on login
[github/shaarli/Shaarli.git] / application / bookmark / BookmarkIO.php
index ae9ffcb4612bd1acbc633d51b3c48c46cd05ff76..6bf7f3654ebfdd41f87b9468f00c135c2725e9da 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Shaarli\Bookmark;
 
+use Shaarli\Bookmark\Exception\DatastoreNotInitializedException;
 use Shaarli\Bookmark\Exception\EmptyDataStoreException;
 use Shaarli\Bookmark\Exception\NotWritableDataStoreException;
 use Shaarli\Config\ConfigManager;
@@ -52,13 +53,14 @@ class BookmarkIO
      *
      * @return BookmarkArray instance
      *
-     * @throws NotWritableDataStoreException Data couldn't be loaded
-     * @throws EmptyDataStoreException       Datastore doesn't exist
+     * @throws NotWritableDataStoreException    Data couldn't be loaded
+     * @throws EmptyDataStoreException          Datastore file exists but does not contain any bookmark
+     * @throws DatastoreNotInitializedException File does not exists
      */
     public function read()
     {
         if (! file_exists($this->datastore)) {
-            throw new EmptyDataStoreException();
+            throw new DatastoreNotInitializedException();
         }
 
         if (!is_writable($this->datastore)) {
@@ -102,7 +104,5 @@ class BookmarkIO
             $this->datastore,
             self::$phpPrefix.base64_encode(gzdeflate(serialize($links))).self::$phpSuffix
         );
-
-        invalidateCaches($this->conf->get('resource.page_cache'));
     }
 }