Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the Symfony application configuration #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions symfony-2.6/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,9 @@ public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
);

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}

return $bundles;
}

Expand Down
65 changes: 1 addition & 64 deletions symfony-2.6/app/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,10 @@
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }

framework:
#esi: ~
#translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true

# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"

# Assetic Configuration
assetic:
debug: "%kernel.debug%"
use_controller: false
bundles: [ ]
#java: /usr/bin/java
filters:
cssrewrite: ~
#closure:
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

# Doctrine Configuration
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# 2. Uncomment database_path in parameters.yml.dist
# 3. Uncomment next line:
# path: "%database_path%"

orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
46 changes: 0 additions & 46 deletions symfony-2.6/app/config/config_dev.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,2 @@
imports:
- { resource: config.yml }

framework:
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }

web_profiler:
toolbar: true
intercept_redirects: false

monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: INFO
VERBOSITY_VERY_VERBOSE: DEBUG
channels: ["!doctrine"]
console_very_verbose:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: NOTICE
VERBOSITY_VERY_VERBOSE: NOTICE
VERBOSITY_DEBUG: DEBUG
channels: ["doctrine"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info

assetic:
use_controller: true

#swiftmailer:
# delivery_address: me@example.com
23 changes: 0 additions & 23 deletions symfony-2.6/app/config/config_prod.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
imports:
- { resource: config.yml }

#framework:
# validation:
# cache: apc

#doctrine:
# orm:
# metadata_cache_driver: apc
# result_cache_driver: apc
# query_cache_driver: apc

monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
14 changes: 0 additions & 14 deletions symfony-2.6/app/config/config_test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
imports:
- { resource: config_dev.yml }

framework:
test: ~
session:
storage_id: session.storage.mock_file
profiler:
collect: false

web_profiler:
toolbar: false
intercept_redirects: false

swiftmailer:
disable_delivery: true
10 changes: 0 additions & 10 deletions symfony-2.6/app/config/parameters.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# This file is auto-generated during the composer install
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root
database_password: null
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: 7a5839f2d26a9c5b98e3e8085d9b191ab12cabbd
14 changes: 0 additions & 14 deletions symfony-2.6/app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
# You should uncomment this if you want use pdo_sqlite
# database_path: "%kernel.root_dir%/data.db3"

mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~

locale: en

# A secret key that's used to generate certain security-related tokens
Expand Down
6 changes: 3 additions & 3 deletions symfony-2.6/app/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
app:
resource: "@AppBundle/Controller/"
type: annotation
hello_world:
path: /hello/index
defaults: { _controller: AppBundle:Hello:index }
20 changes: 0 additions & 20 deletions symfony-2.6/app/config/routing_dev.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt

_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler

_configurator:
resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
prefix: /_configurator

_errors:
resource: "@TwigBundle/Resources/config/routing/errors.xml"
prefix: /_error

_main:
resource: routing.yml

# AcmeDemoBundle routes (to be removed)
_acme_demo:
resource: "@AcmeDemoBundle/Resources/config/routing.yml"
9 changes: 0 additions & 9 deletions symfony-2.6/src/Acme/DemoBundle/AcmeDemoBundle.php

This file was deleted.

48 changes: 0 additions & 48 deletions symfony-2.6/src/Acme/DemoBundle/Command/HelloWorldCommand.php

This file was deleted.

56 changes: 0 additions & 56 deletions symfony-2.6/src/Acme/DemoBundle/Controller/DemoController.php

This file was deleted.