2017 © Pedro Peláez
 

library collapser

A PHP media collapser with CSS and JS extensions.

image

salernolabs/collapser

A PHP media collapser with CSS and JS extensions.

  • Friday, May 12, 2017
  • by ericsalerno
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

salernolabs/collapser

Latest Stable Version License Build Status, (*1)

A PHP media collapser/minifier with CSS and JS extensions. Not really re-inventing the wheel this code was written years ago in my proprietary Chorizo platform. Just moving it out into it's own library. I am fully aware that many developers hate inheritance and protected members/methods. For those offended, I apologize, that's just how this was built., (*2)

Usage

Include this project with composer:, (*3)

composer require salernolabs/collapser

CSS

You can create an instance of the collapser you need, default media (useless), CSS, or Javascript., (*4)

$collapser = new \SalernoLabs\Collapser\CSS();
$collapser->setDeleteComments(true);

$output = $collapser->collapse($input);

If the input CSS is:, (*5)

.helloCSS {
    display: none;
}

#somecss {
    color: #ffffff;
    background: url('/images/whatever.gif');
}

The value of $output would be:, (*6)

.helloCSS{display:none;}

Javascript

$collapser = new \SalernoLabs\Collapser\Javascript();
$collapser->setDeleteComments(true);

$output = $collapser->collapse($input);

If the input Javascript is:, (*7)

/**
 Javascript test
 */
var x = 13;

function test(i, j, x)
{
    var output = i + j + x;

    return output;
}

//Run the function in the alert
var detail = test(1, 2, 3);
alert(detail);

The value of $output should be:, (*8)

var x=13;function test(i, j, x){var output=i+j+x;return output;}var detail=test(1, 2, 3);alert(detail);

Note that it doesn't remove spaces for parameters of functions., (*9)

The Versions

12/05 2017

dev-master

9999999-dev http://www.salernolabs.com/

A PHP media collapser with CSS and JS extensions.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

css php js media collapser

12/05 2017

0.1.0

0.1.0.0 http://www.salernolabs.com/

A PHP media collapser with CSS and JS extensions.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

css php js media collapser