diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2017-01-27 09:34:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 09:34:32 +0100 |
commit | 6fb06904ecde15b1b07d0a2af945338b416cf0e2 (patch) | |
tree | e76f3e8142399316ec5660fab8c646b2c34b8336 /src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |
parent | 05fa529bcfde01be5d320cb532900d72cf4b0830 (diff) | |
parent | 78295b99dd1721c613f1ce52e2debbe6f6db7753 (diff) | |
download | wallabag-6fb06904ecde15b1b07d0a2af945338b416cf0e2.tar.gz wallabag-6fb06904ecde15b1b07d0a2af945338b416cf0e2.tar.zst wallabag-6fb06904ecde15b1b07d0a2af945338b416cf0e2.zip |
Merge pull request #2416 from wallabag/2.2
wallabag 2.2.0
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')) { |