2017 © Pedro Peláez
 

library gulp-rev-versions-bundle

A bundle that allows symfony to get the version of assets versioned with gulp-rev

image

irozgar/gulp-rev-versions-bundle

A bundle that allows symfony to get the version of assets versioned with gulp-rev

  • Monday, June 26, 2017
  • by irozgar
  • Repository
  • 2 Watchers
  • 12 Stars
  • 6,791 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 4 Versions
  • 15 % Grown

The README.md

GulpRevVersionsBundle

Build Status SensioLabsInsight, (*1)

This bundle helps you using your assets versioned with gulp-rev in a symfony project by making the twig function asset return the files mapped in your gulp-rev manifest., (*2)

DEPRECATED This bundle is deprecated and will be abandoned when symfony 2.8 support finishes on November 2019. Since version 3.3, symfony includes the option json_manifest_path that does the same as this bundle, I recommend using that instead of this bundle. For previous versions the recommendation is to update symfony to a stable version and start using the option json_manifest_path., (*3)

Installation

Step 1. Download with composer

composer require irozgar/gulp-rev-versions-bundle

Step 2. Add the bundle to AppKernel

<?php
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Irozgar\GulpRevVersionsBundle\IrozgarGulpRevVersionsBundle(),
        );
    }
}

Step 3. Configure your bundle

The configuration of the bundle depends on the symfony version, (*4)

Symfony version < 3.1

Now you have to make the bundle replace the default version strategy for your assets. To make this add the following to your config.yml file:, (*5)

# app/config/config.yml

irozgar_gulp_rev_versions:
    replace_default_version_strategy: ~

    # This section is needed only if you use symfony packages
    # packages in this list will use the version strategy
    packages:
        - one_package
        - another_package

WARNING If your Symfony version is 3.0 you should be using the versions 1.x of twig because twig 2.0 introduced some changes that broke compatibility with that version of Symfony after its support finished (link)., (*6)

Symfony version >= 3.1 && < 4.0

This symfony version introduced a new option to configure the version strategy., (*7)

Add this to your config.yml to tell symfony what version strategy it should use, (*8)

# app/config/config.yml

framework:
    # ...
    assets:
        version_strategy: irozgar_gulp_rev_versions.asset.gulp_rev_version_strategy

# ...

# This is only needed if using a custom path for the manifest file
irozgar_gulp_rev_versions:
    manifest_path: "your/custom/path/rev-manifest.json"

NOTE Since symfony 3.3 the framework includes a version strategy to load assets using a manifest file. more info, (*9)

Configuring the manifest file path

The default location of the rev-manifest.json file is app/Resources/assets/rev-manifest.json. You can customize it by adding the following lines to your config.yml, (*10)

# app/config/config.yml

irozgar_gulp_rev_versions:
    manifest_path: "your/custom/path/rev-manifest.json"

NOTE All paths will be relative to %kernel.root_dir%, (*11)

The Versions

26/06 2017

dev-master

9999999-dev

A bundle that allows symfony to get the version of assets versioned with gulp-rev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Isaac Rozas

twig css javascript bundle symfony assets asset js version gulp-rev rev-manifest

21/02 2017

v1.0.2

1.0.2.0

A bundle that allows symfony to get the version of assets versioned with gulp-rev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Isaac Rozas

twig css javascript bundle symfony assets asset js version gulp-rev rev-manifest

25/09 2016

v1.0.1

1.0.1.0

A bundle that allows symfony to get the version of assets versioned with gulp-rev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Isaac Rozas

twig css javascript bundle symfony assets asset js version gulp-rev rev-manifest

13/09 2016

v1.0.0

1.0.0.0

A bundle that allows symfony to get the version of assets versioned with gulp-rev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Isaac Rozas

twig css javascript bundle symfony assets asset js version gulp-rev rev-manifest