Skip to content

Commit da1a0b5

Browse files
vid prep
1 parent d41fb40 commit da1a0b5

12 files changed

+193
-127
lines changed

app/AppKernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public function registerBundles()
2929
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
3030
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
3131

32+
$bundles[] = new EightPoints\Bundle\GuzzleBundle\GuzzleBundle();
33+
3234
if ('dev' === $this->getEnvironment()) {
3335
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
3436
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();

app/config/config.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ imports:
22
- { resource: parameters.yml }
33
- { resource: security.yml }
44
- { resource: services.yml }
5+
- { resource: services/doctrine_entity_repository.yml }
6+
- { resource: services/repository.yml }
57

68
# Put parameters here that don't need to change on each machine where the app is deployed
79
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
@@ -67,3 +69,54 @@ swiftmailer:
6769
username: '%mailer_user%'
6870
password: '%mailer_password%'
6971
spool: { type: memory }
72+
73+
74+
# Nelmio CORS
75+
nelmio_cors:
76+
defaults:
77+
allow_origin: ["*"]
78+
allow_methods: ["POST", "PUT", "GET", "DELETE", "OPTIONS"]
79+
allow_headers: ["content-type", "authorization", "Content-Disposition"]
80+
expose_headers: ["Accept-Ranges", "Location"]
81+
max_age: 3600
82+
paths:
83+
'^/': ~
84+
85+
86+
# Nelmio API Doc
87+
nelmio_api_doc:
88+
sandbox:
89+
accept_type: "application/json"
90+
body_format:
91+
formats: [ "json" ]
92+
default_format: "json"
93+
request_format:
94+
formats:
95+
json: "application/json"
96+
97+
# FOS REST Bundle
98+
fos_rest:
99+
body_listener: true
100+
param_fetcher_listener: true
101+
view:
102+
view_response_listener: 'force'
103+
formats:
104+
jsonp: true
105+
json: true
106+
xml: false
107+
rss: false
108+
mime_types:
109+
json: ['application/json', 'application/x-json']
110+
jpg: ['image/jpeg']
111+
png: ['image/png']
112+
jsonp_handler: ~
113+
routing_loader:
114+
default_format: json
115+
include_format: false
116+
format_listener:
117+
rules:
118+
- { path: ^/, priorities: [ json, jsonp ], fallback_format: ~, prefer_extension: true }
119+
exception:
120+
enabled: true
121+
serializer:
122+
serialize_null: true

app/config/config_acceptance.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
imports:
22
- { resource: config.yml }
33

4-
#doctrine:
5-
# orm:
6-
# metadata_cache_driver: apc
7-
# result_cache_driver: apc
8-
# query_cache_driver: apc
9-
104
monolog:
115
handlers:
12-
buffered:
13-
type: buffer
14-
handler: easylog
15-
channels: ["!event"]
16-
level: debug
17-
easylog:
18-
type: service
19-
id: easycorp.easylog.handler
206
main:
217
type: fingers_crossed
228
action_level: error

app/config/routing.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ widget:
33
resource: AppBundle\Controller\WidgetController
44

55

6-
app:
7-
resource: '@AppBundle/Controller/'
8-
type: annotation

app/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
resource: '../../src/AppBundle/*'
2121
# you can exclude directories or files
2222
# but if a service is unused, it's removed anyway
23-
exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
23+
exclude: '../../src/AppBundle/{Entity,Tests}'
2424

2525
# controllers are imported separately to make sure they're public
2626
# and have a tag that allows actions to type-hint services
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
3+
_defaults:
4+
autowire: true
5+
autoconfigure: true
6+
public: false
7+
8+
AppBundle\Entity\Repository\:
9+
resource: '../../../src/AppBundle/Entity/Repository/*'

app/config/services/repository.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
3+
_defaults:
4+
autowire: true
5+
autoconfigure: true
6+
public: false
7+
8+
AppBundle\Repository\:
9+
resource: '../../../src/AppBundle/Repository/*'

composer.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,19 @@
2323
"php": ">=5.5.9",
2424
"doctrine/doctrine-bundle": "^1.6",
2525
"doctrine/orm": "^2.5",
26+
"friendsofsymfony/rest-bundle": "^2.2.0",
2627
"incenteev/composer-parameter-handler": "^2.0",
28+
"jms/serializer-bundle": "^1.1",
29+
"nelmio/api-doc-bundle": "^2.13",
30+
"nelmio/cors-bundle": "^1.4",
31+
"roave/security-advisories": "dev-master",
2732
"sensio/distribution-bundle": "^5.0.19",
2833
"sensio/framework-extra-bundle": "^3.0.2",
2934
"symfony/monolog-bundle": "^3.1.0",
3035
"symfony/polyfill-apcu": "^1.0",
3136
"symfony/swiftmailer-bundle": "^2.3.10",
3237
"symfony/symfony": "3.3.*",
33-
"twig/twig": "^1.0||^2.0",
34-
35-
"nelmio/cors-bundle": "^1.4",
36-
"nelmio/api-doc-bundle": "^2.13",
37-
"friendsofsymfony/rest-bundle": "^2.2.0",
38-
"jms/serializer-bundle": "^1.1",
39-
"roave/security-advisories": "dev-master",
40-
"easycorp/easy-log-handler": "^1.0"
38+
"twig/twig": "^1.0||^2.0"
4139
},
4240
"require-dev": {
4341
"sensio/generator-bundle": "^3.0",
@@ -47,7 +45,7 @@
4745
"behat/symfony2-extension": "^2.1",
4846
"behat/web-api-extension": "~1.0@dev",
4947
"behatch/contexts": "dev-master",
50-
"csa/guzzle-bundle": "^2.2.1"
48+
"eightpoints/guzzle-bundle": "^6.0"
5149
},
5250
"scripts": {
5351
"symfony-scripts": [

0 commit comments

Comments
 (0)