diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-01-18 10:01:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-18 10:01:06 +0100 |
commit | 3fb29fdda04ca86e04422d49b86cf646d53c4f9d (patch) | |
tree | adf8512f93f5559ba87d0c9931969ae4ebea7133 /application/api/ApiMiddleware.php | |
parent | 796c4c57d085ae4589b53dfe8369ae9ba30ffdaf (diff) | |
parent | e26e2060f5470ce8bf4c5973284bae07b8af170a (diff) | |
download | Shaarli-3fb29fdda04ca86e04422d49b86cf646d53c4f9d.tar.gz Shaarli-3fb29fdda04ca86e04422d49b86cf646d53c4f9d.tar.zst Shaarli-3fb29fdda04ca86e04422d49b86cf646d53c4f9d.zip |
Store bookmarks as PHP objects and add a service layer to retriā¦ (#1307)
Store bookmarks as PHP objects and add a service layer to retrieve them
Diffstat (limited to 'application/api/ApiMiddleware.php')
-rw-r--r-- | application/api/ApiMiddleware.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/application/api/ApiMiddleware.php b/application/api/ApiMiddleware.php index 2d55bda6..4745ac94 100644 --- a/application/api/ApiMiddleware.php +++ b/application/api/ApiMiddleware.php | |||
@@ -3,6 +3,7 @@ namespace Shaarli\Api; | |||
3 | 3 | ||
4 | use Shaarli\Api\Exceptions\ApiAuthorizationException; | 4 | use Shaarli\Api\Exceptions\ApiAuthorizationException; |
5 | use Shaarli\Api\Exceptions\ApiException; | 5 | use Shaarli\Api\Exceptions\ApiException; |
6 | use Shaarli\Bookmark\BookmarkFileService; | ||
6 | use Shaarli\Config\ConfigManager; | 7 | use Shaarli\Config\ConfigManager; |
7 | use Slim\Container; | 8 | use Slim\Container; |
8 | use Slim\Http\Request; | 9 | use Slim\Http\Request; |
@@ -117,7 +118,7 @@ class ApiMiddleware | |||
117 | } | 118 | } |
118 | 119 | ||
119 | /** | 120 | /** |
120 | * Instantiate a new LinkDB including private links, | 121 | * Instantiate a new LinkDB including private bookmarks, |
121 | * and load in the Slim container. | 122 | * and load in the Slim container. |
122 | * | 123 | * |
123 | * FIXME! LinkDB could use a refactoring to avoid this trick. | 124 | * FIXME! LinkDB could use a refactoring to avoid this trick. |
@@ -126,10 +127,10 @@ class ApiMiddleware | |||
126 | */ | 127 | */ |
127 | protected function setLinkDb($conf) | 128 | protected function setLinkDb($conf) |
128 | { | 129 | { |
129 | $linkDb = new \Shaarli\Bookmark\LinkDB( | 130 | $linkDb = new BookmarkFileService( |
130 | $conf->get('resource.datastore'), | 131 | $conf, |
131 | true, | 132 | $this->container->get('history'), |
132 | $conf->get('privacy.hide_public_links') | 133 | true |
133 | ); | 134 | ); |
134 | $this->container['db'] = $linkDb; | 135 | $this->container['db'] = $linkDb; |
135 | } | 136 | } |