matthecat/htmlcompressor-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony2 bundle which allow to minify cacheable HTML and XML responses using htmlcompressor

Installs: 10 404

Dependents: 0

Suggesters: 0

Security: 0

Stars: 12

Watchers: 3

Forks: 4

Open Issues: 0

Type:symfony-bundle

dev-master 2013-06-07 13:28 UTC

This package is not auto-updated.

Last update: 2020-01-19 13:18:34 UTC


README

Allow to minify cacheable HTML and XML responses using htmlcompressor.

Installation

Get the bundle

Add this line in your composer.json require section:

"matthecat/htmlcompressor-bundle": "dev-master"

and run this command in your project directory:

$ php composer.phar update matthecat/htmlcompressor-bundle

Enable the bundle

Edit your application's kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new MatTheCat\HtmlCompressorBundle\MatTheCatHtmlCompressorBundle(),
    );
}

Now, it's time to configure it!

Configuration

# app/config/config.yml
html_compressor:
    enabled: true
    java:    /usr/bin/java
    jar:     ~
    options: {}
Description Default value Exemple
enabled determine if responses must be minified if they can true -
java path to Java executable /usr/bin/java -
jar path to htmlcompressor executable - %kernel.root_dir%/Resources/java/htmlcompressor-1.5.3.jar
options any option described in the htmlcompressor documentation - { '--compress-js': ~, '--js-compressor': closure }