diff options
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/WallabagRestController.php')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index e927a890..544c1ea9 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -8,6 +8,20 @@ use Wallabag\CoreBundle\Entity\Entry; | |||
8 | 8 | ||
9 | class WallabagRestController extends FOSRestController | 9 | class WallabagRestController extends FOSRestController |
10 | { | 10 | { |
11 | /** | ||
12 | * Retrieve version number. | ||
13 | * | ||
14 | * @ApiDoc() | ||
15 | * | ||
16 | * @return JsonResponse | ||
17 | */ | ||
18 | public function getVersionAction() | ||
19 | { | ||
20 | $version = $this->container->getParameter('wallabag_core.version'); | ||
21 | $json = $this->get('serializer')->serialize($version, 'json'); | ||
22 | return (new JsonResponse())->setJson($json); | ||
23 | } | ||
24 | |||
11 | protected function validateAuthentication() | 25 | protected function validateAuthentication() |
12 | { | 26 | { |
13 | if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { | 27 | if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { |