3 namespace Shaarli\Api\Controllers
;
5 use Shaarli\Bookmark\BookmarkFilter
;
7 use Slim\Http\Response
;
12 * REST API Controller: /info
14 * @package Api\Controllers
15 * @see http://shaarli.github.io/api-documentation/#links-instance-information-get
17 class Info
extends ApiController
20 * Service providing various information about Shaarli instance.
22 * @param Request $request Slim request.
23 * @param Response $response Slim response.
25 * @return Response response.
27 public function getInfo($request, $response)
30 'global_counter' => $this->bookmarkService
->count(),
31 'private_counter' => $this->bookmarkService
->count(BookmarkFilter
::$PRIVATE),
33 'title' => $this->conf
->get('general.title', 'Shaarli'),
34 'header_link' => $this->conf
->get('general.header_link', '?'),
35 'timezone' => $this->conf
->get('general.timezone', 'UTC'),
36 'enabled_plugins' => $this->conf
->get('general.enabled_plugins', []),
37 'default_private_links' => $this->conf
->get('privacy.default_private_links', false),
41 return $response->withJson($info, 200, $this->jsonStyle
);