symfony - Symfony2 in prod can see code changes -
i noticed if changed source code, affects production environment. behaviour normal?
i suppose regenerating cache on file change should happen in dev environment , changes source code should not apply in prod cache.
this 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 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 cache command :
app/console cache:clear --env=prod --no-debug
it affect both environments not environments more modes. can execute changes in dev mode or production mode regardless code effect both modes of dev , production. dev mode lets view stats, logs etc along debug messages may not want show in production mode.
Comments
Post a Comment