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