2017 © Pedro Peláez
 

library compressor-bundle

Html compressor and optimizer bundle

image

icedevelopment/compressor-bundle

Html compressor and optimizer bundle

  • Wednesday, January 13, 2016
  • by icedevelopment
  • Repository
  • 1 Watchers
  • 0 Stars
  • 57 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Html Compressor bundle for Symfony2

Requirements:

  • Symfony 2 (>= 2.2)

Installation:

  • Include this bundle in your composer.json
$ php composer.phar require icedevelopment/compressor-bundle dev-master

Enable the bundle in your AppKernel.php, (*1)

<?php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Kcs\CompressorBundle\KcsCompressorBundle(),
            ...
        );
        ...
    }
}

Configuration

You can enable or disable preservers and compressors changing one of these flags in your config.yml, (*2)

kcs_compressor:
    enabled:              true      # Set to false to disable the compressor
    compress_html:        true      # Enable HTML optimizations
    preserve_line_breaks:  true     # Enable the line breaks preservation
    remove_comments:      true      # Remove HTML comments while compressing
    remove_extra_spaces:  true      # Remove extra spaces in HTML
    compress_js:          true      # Enable inline js compression
    compress_css:         true      # Enable inline css compression
    skip_block_tag:         '\#\#\#'      # Allow to change skipBlockTag, to make it compatible with twig

If inline js (or css) compression is enabled you must specify the compressor to be used:, (*3)

kcs_compressor:
    js_compressor:        none      # Can be none (disabled), yui or custom
    css_compressor:       none      # Can be none (disabled), yui or custom

You can specify a custom class for the inline js and css compressors. Use the js_compressor_class and the css_compressor_class setting to specify which classes must be used., (*4)

The custom inline compressor class must implement the Kcs\CompressorBundle\Compressor\InlineCompressorInterface interface and export a compress public function accepting the uncompressed content as argument and returning the compressed block, (*5)

YUI compressor

If the yui compressor is used the YUI jar file location must be specified in the yui_jar setting. You can also change the java executable path modifying the java_path setting. If not specified defaults to /usr/bin/java., (*6)

The Versions

13/01 2016

dev-master

9999999-dev

Html compressor and optimizer bundle

  Sources   Download

MIT

The Requires

 

13/01 2016

0.2

0.2.0.0

Html compressor and optimizer bundle

  Sources   Download

MIT

The Requires

 

27/05 2015

v0.1

0.1.0.0

Html compressor and optimizer bundle

  Sources   Download

MIT

The Requires