title: symfony2 and snc-redis: how to disable it depending of environement?
body: <p>I'm using snc-redis to cache my doctrine queries and everything works well.</p>
  
  <p>As I'm working on a team, I decided to put the redis server on a remote machine but it encounters an error on connection "Error while writing bytes to the server [tcp://xxx.xxx.xxx.xxx:6379"</p>
  
  <p>So I'm considering to deploy redis only for the production server and disable it for our development. The problem is for each repository we use predis query caching functions which lead to issues because no redis service is available.</p>
  
  <p>Here is my configuration:</p>
  
  <pre><code>snc_redis:
  # configure predis as client
  clients:
      default:
          type: predis
          alias: default
          dsn: "redis://%redis_url%"
      doctrine:
          type: predis
          alias: doctrine
          dsn: "redis://%redis_url%"
  # configure doctrine caching
  doctrine:
      metadata_cache:
          client: doctrine
          entity_manager: default
          document_manager: default
      result_cache:
          client: doctrine
          entity_manager: [default]
          namespace: "doctrine_result_cache_%kernel.environment%_"
      query_cache:
          client: doctrine
          entity_manager: default
  </code></pre>