Code snippets for symfony 1.x

Navigation

Refine Tags

Snippets tagged "noscript prod"

Noscript "off" in dev with "prod" controller and "on" in prod with the same settings.yml file

[Edit 06/02/09] Enabling the apache mod_rewrite is a little faster than using this snippet. ;)

Well if you are using Windows + Wamp for your dev, the "noscript" setting (settings.yml) does not work well when you are using the prod controller to test your application with you dev computer. (if mod_rewrite is not installed)

So i wanted to deactivate this settings in dev environment with the prod controller and having it on in prod with the prod controller without having 2 different settings.yml files.

So here here a small tip for this:

prod:
  .settings:
    no_script_name:         <?php echo ((isset($_SERVER['HTTP_HOST']) && strstr($_SERVER['HTTP_HOST'], 'dev') ? 'off' : 'on')) . "\n"; ?>
    logging_enabled:        on
 

This code assumes that your dev url contains "dev" like http://dev.blogsnippets.com.

by Loïc Vernet on 2009-01-19, tagged dev  noscript  prod  settings 
(2 comments)