Tuesday, 3 September 2013

Symfony2 in prod can see code changes

Symfony2 in prod can see code changes

I noticed if I changed the source code, it affects the production
environment. Is this behaviour normal?
I suppose regenerating cache on file change should only happen in dev
environment and changes to the source code should not apply in prod cache.
This is my app.php file:
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
This is my config_prod.yml
imports:
- { resource: config.yml }
framework:
router:
strict_requirements: null
and config.yml :
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: databases.yml }
framework:
translator: { fallback: %locale% }
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: %kernel.debug%
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig','php']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_proxies: ~
session: ~
fragments: ~
# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
I clear the cache with this command :
app/console cache:clear --env=prod --no-debug
Thank you

No comments:

Post a Comment