diff options
author | ArthurHoaro <arthur@hoa.ro> | 2019-05-25 15:52:27 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-01-18 09:55:59 +0100 |
commit | cf92b4dd1521241eefc58eaf6dcd202cd83969d8 (patch) | |
tree | 9d6f6f4dc9eabe111c3ba5609eea8b22cd5a23aa /application/api/ApiMiddleware.php | |
parent | 336a28fa4a09b968ce4705900bf57693e672f0bf (diff) | |
download | Shaarli-cf92b4dd1521241eefc58eaf6dcd202cd83969d8.tar.gz Shaarli-cf92b4dd1521241eefc58eaf6dcd202cd83969d8.tar.zst Shaarli-cf92b4dd1521241eefc58eaf6dcd202cd83969d8.zip |
Apply the new system (Bookmark + Service) to the whole code base
See https://github.com/shaarli/Shaarli/issues/1307
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 | } |