mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-11 17:35:25 +00:00
commit
e8331dd9e7
4 changed files with 29 additions and 10 deletions
|
@ -112,12 +112,26 @@ swiftmailer:
|
||||||
fos_rest:
|
fos_rest:
|
||||||
param_fetcher_listener: true
|
param_fetcher_listener: true
|
||||||
body_listener: true
|
body_listener: true
|
||||||
format_listener: true
|
|
||||||
view:
|
view:
|
||||||
|
mime_types:
|
||||||
|
csv:
|
||||||
|
- 'text/csv'
|
||||||
|
- 'text/plain'
|
||||||
|
pdf:
|
||||||
|
- 'application/pdf'
|
||||||
|
epub:
|
||||||
|
- 'application/epub+zip'
|
||||||
|
mobi:
|
||||||
|
- 'application/x-mobipocket-ebook'
|
||||||
view_response_listener: 'force'
|
view_response_listener: 'force'
|
||||||
formats:
|
formats:
|
||||||
xml: true
|
xml: true
|
||||||
json : true
|
json: true
|
||||||
|
txt: true
|
||||||
|
csv: true
|
||||||
|
pdf: true
|
||||||
|
epub: true
|
||||||
|
mobi: true
|
||||||
templating_formats:
|
templating_formats:
|
||||||
html: true
|
html: true
|
||||||
force_redirects:
|
force_redirects:
|
||||||
|
@ -126,6 +140,15 @@ fos_rest:
|
||||||
default_engine: twig
|
default_engine: twig
|
||||||
routing_loader:
|
routing_loader:
|
||||||
default_format: json
|
default_format: json
|
||||||
|
format_listener:
|
||||||
|
enabled: true
|
||||||
|
rules:
|
||||||
|
- { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: false, prefer_extension: false }
|
||||||
|
- { path: "^/api", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false }
|
||||||
|
- { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false }
|
||||||
|
# for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener
|
||||||
|
# so we need to add custom rule for custom api export but also for all other routes of the application...
|
||||||
|
- { path: '^/', priorities: ['text/html', '*/*'], fallback_format: html, prefer_extension: false }
|
||||||
|
|
||||||
nelmio_api_doc:
|
nelmio_api_doc:
|
||||||
sandbox:
|
sandbox:
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
Rest_Wallabag:
|
Rest_Wallabag:
|
||||||
type : rest
|
type : rest
|
||||||
resource: "@WallabagApiBundle/Resources/config/routing_rest.yml"
|
resource: "@WallabagApiBundle/Resources/config/routing_rest.yml"
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@
|
||||||
"sensio/framework-extra-bundle": "^3.0.2",
|
"sensio/framework-extra-bundle": "^3.0.2",
|
||||||
"incenteev/composer-parameter-handler": "^2.0",
|
"incenteev/composer-parameter-handler": "^2.0",
|
||||||
"nelmio/cors-bundle": "~1.4.0",
|
"nelmio/cors-bundle": "~1.4.0",
|
||||||
"friendsofsymfony/rest-bundle": "~1.4",
|
"friendsofsymfony/rest-bundle": "~2.1",
|
||||||
"jms/serializer-bundle": "~1.0",
|
"jms/serializer-bundle": "~1.1",
|
||||||
"nelmio/api-doc-bundle": "~2.7",
|
"nelmio/api-doc-bundle": "~2.7",
|
||||||
"mgargano/simplehtmldom": "~1.5",
|
"mgargano/simplehtmldom": "~1.5",
|
||||||
"tecnickcom/tcpdf": "~6.2",
|
"tecnickcom/tcpdf": "~6.2",
|
||||||
|
|
|
@ -12,7 +12,6 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
use FOS\RestBundle\Controller\Annotations\Route;
|
|
||||||
|
|
||||||
class WallabagRestController extends FOSRestController
|
class WallabagRestController extends FOSRestController
|
||||||
{
|
{
|
||||||
|
@ -167,8 +166,6 @@ class WallabagRestController extends FOSRestController
|
||||||
* }
|
* }
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
* @Route(requirements={"_format"="epub|mobi|pdf|txt|csv"})
|
|
||||||
*
|
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getEntryExportAction(Entry $entry, Request $request)
|
public function getEntryExportAction(Entry $entry, Request $request)
|
||||||
|
|
Loading…
Reference in a new issue