New config file

This commit is contained in:
Romain Neutron
2012-02-21 18:04:25 +01:00
parent 3523f0364d
commit 45c7e9cb8d
2 changed files with 131 additions and 111 deletions

View File

@@ -25,6 +25,8 @@ dev:
#Services are defined in service.yml configuration file #Services are defined in service.yml configuration file
template_engine: twig_debug template_engine: twig_debug
orm: doctrine_dev orm: doctrine_dev
cache: array_cache
opcodecache: array_cache
############## ##############
# PRODUCTION # # PRODUCTION #
@@ -39,6 +41,8 @@ prod:
template_engine: twig template_engine: twig
orm: doctrine_prod orm: doctrine_prod
cache: memcache_cache
opcodecache: apc_cache
############## ##############
# TEST # # TEST #
@@ -53,4 +57,6 @@ test:
template_engine: twig_debug template_engine: twig_debug
orm: doctrine_test orm: doctrine_test
cache: array_cache
opcodecache: array_cache

View File

@@ -1,35 +1,9 @@
#Define a template engine service
#Only Twig is avalaible as a template engine service
#see http://twig.sensiolabs.org/
#Define the service name first
twig:
#Template engine type
type: twig
options:
#When set to true, the generated templates have a __toString() method that you can use to display the generated nodes
debug: false
#The charset used by the templates
charset: utf-8
#Twig will silently ignore invalid variables (variables and or attributes/methods that do not exist)
#And replace them with a null value. When set to true, Twig throws an exception instead (default to false)
strict_variables: true
#Optimize the node tree before compilation
optimizer: true
twig_debug:
type: twig
options:
debug: true
charset: utf-8
strict_variables: true
autoescape: true
optimizer: true
Orm:
#Doctrine developement service options #Doctrine developement service options
#Service name #Service name
doctrine_dev: doctrine_dev:
type: doctrine type: Orm\Doctrine
options: options:
#Set automatically propers values for debug #Set automatically propers values for debug
#Query & result caches are setted to Array cache #Query & result caches are setted to Array cache
@@ -37,53 +11,92 @@ doctrine_dev:
debug: true debug: true
#Assign a connexion from connexions.yml to the DataBase Abstraction Layer #Assign a connexion from connexions.yml to the DataBase Abstraction Layer
dbal: main_connexion dbal: main_connexion
orm:
#Available cache driver [memcached, apc, array] #Available cache driver [memcached, apc, array]
#Query cache : is used to cache the transformation of a DQL query to its SQL counterpart #Query cache : is used to cache the transformation of a DQL query to its SQL counterpart
#Result cache : is used to cache the results of your queries #Result cache : is used to cache the results of your queries
#Metadata cache : is used to cache entity class metadatas #Metadata cache : is used to cache entity class metadatas
#If No cache is provided all cache are setted to default_cache which is an array cache type #If No cache is provided all cache are setted to default_cache which is an array cache type
cache: cache:
query: array_cache query:
result: array_cache service: Cache\array_cache
metadata: array_cache result:
service: Cache\array_cache
metadata:
service: Cache\array_cache
# Assign a service to log doctrine queries # Assign a service to log doctrine queries
log: query_logger log:
service: Log\query_logger
# Doctrine test service options # Doctrine test service options
doctrine_test: doctrine_test:
type: doctrine type: Orm\Doctrine
options: options:
debug: true debug: true
#Doctrine use a different connection configuration base to run tests #Doctrine use a different connection configuration base to run tests
dbal: test_connexion dbal: test_connexion
orm:
cache: cache:
query: array_cache query:
result: array_cache service: Cache\array_cache
metadata: array_cache result:
log: query_logger service: Cache\array_cache
metadata:
service: Cache\array_cache
log:
service: Log\query_logger
# Doctrine production service options # Doctrine production service options
doctrine_prod: doctrine_prod:
type: doctrine type: Orm\Doctrine
options: options:
debug: false debug: false
dbal: main_connexion dbal: main_connexion
orm:
cache: cache:
query: apc_cache query:
result: apc_cache service: Cache\apc_cache
metadata: apc_cache result:
service: Cache\memcache_cache
metadata:
service: Cache\apc_cache
TemplateEngine:
#Define a template engine service
#Only Twig is avalaible as a template engine service
#see http://twig.sensiolabs.org/
#Define the service name first
twig:
#Template engine type
type: TemplateEngine\Twig
options:
#When set to true, the generated templates have a __toString() method that you can use to display the generated nodes
debug: false
#The charset used by the templates
charset: utf-8
#Twig will silently ignore invalid variables (variables and or attributes/methods that do not exist)
#And replace them with a null value. When set to true, Twig throws an exception instead (default to false)
strict_variables: false
autoescape: true
#Optimize the node tree before compilation
optimizer: true
twig_debug:
type: TemplateEngine\Twig
options:
debug: true
charset: utf-8
strict_variables: true
autoescape: true
optimizer: true
Log:
# Define a Log service # Define a Log service
# This one is defined to handle the logs of doctrine queries # This one is defined to handle the logs of doctrine queries
# Only Monolog is available as a logger service # Only Monolog is available as a logger service
# Please Notice that for doctrine ONLY a echo logger service is available, see below # Please Notice that for doctrine ONLY a echo logger service is available, see below
# Monolog logger use the PHP Monolog library to handle logs using differents handlers # Monolog logger use the PHP Monolog library to handle logs using differents handlers
query_logger: query_logger:
type: monolog type: Log\Doctrine\Monolog
options: options:
#You can precise the output format #You can precise the output format
#This option is only available when log are used to log doctrine queries #This option is only available when log are used to log doctrine queries
@@ -108,22 +121,23 @@ query_logger:
# phpecho logger logs doctrine queries to the standard output using echo/var_dump # phpecho logger logs doctrine queries to the standard output using echo/var_dump
# Notice that phpecho logger do not have options # Notice that phpecho logger do not have options
sql_logger: sql_logger:
type: phpecho type: Log\Phpecho
Cache:
#Define cache services #Define cache services
#There are Four deffirent cache type available [array, xcache, apc, memcache] #There are Four deffirent cache type available [array, xcache, apc, memcache]
#Only a memcache service can take option to define port & host for the memcache server #Only a memcache service can take option to define port & host for the memcache server
array_cache: array_cache:
type: array type: Cache\ArrayCache
memcache_cache: memcache_cache:
type: memcache type: Cache\MemcacheCache
options: options:
host: localhost host: localhost
port: 11211 port: 11211
apc_cache: apc_cache:
type: apc type: Cache\ApcCache
xcache_cache: xcache_cache:
type: xcache type: Cache\XcacheCache