Created
October 24, 2012 18:02
-
-
Save lavoiesl/3947737 to your computer and use it in GitHub Desktop.
Automatic cache busting using Git commit in Symfony2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// app/config/assets_version.php | |
$container->loadFromExtension('framework', array( | |
'templating' => array( | |
'engines' => array('twig'), | |
'assets_version' => exec('git rev-parse --short HEAD'), | |
), | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/config/config.yml | |
imports: | |
- { resource: parameters.yml } | |
#... | |
- { resource: assets_version.php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why don't just set parameter and use it later in config file? It's much simpler and transparent.