Download the PHP package emileperron/git-version-strategy-bundle without Composer
On this page you can find all versions of the php package emileperron/git-version-strategy-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download emileperron/git-version-strategy-bundle
More information about emileperron/git-version-strategy-bundle
Files in emileperron/git-version-strategy-bundle
Package git-version-strategy-bundle
Short Description A custom version strategy for Symfony assets that uses the current Git commit short-hash as the version identifier.
License MIT
Informations about the package git-version-strategy-bundle
Symfony asset versioning based on Git
This is a small Symfony bundle that implements a custom version strategy which uses the current Git commit short-hash as the version identifier.
This will turn the URL of your assets from this:
to
This will ensure that you assets always match the current version of your project by eliminating browser caching issues.
Getting started
To get started, add the bundle to your project using Composer, like so:
Then, in your config/bundles.php
file, include the bundle like so:
Once that's done, you should be all set!
The bundle automatically updates the configuration for framework.assets.version_strategy
to use the GitVersionStrategy
.
Manual configuration of the VersionStrategy
If for some reason the configuration is not set automatically, which can happen if another bundle also changes this configuration, define the following configuration in your config/packages/framework.yaml
:
Safe mode, execution operator and shell_exec()
This bundle uses the Execution Operator in order to get the current commit's hash. It is important to note that this will not work when safe mode is enabled or shell_exec() is disabled.
All versions of git-version-strategy-bundle with dependencies
symfony/asset Version >=3.1.0
symfony/framework-bundle Version *