2017 © Pedro Peláez
 

library uglify

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

image

nodejs-php-fallback/uglify

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 16 % Grown

The README.md

uglify

Latest Stable Version Build Status StyleCI Test Coverage Code Climate, (*1)

Simple PHP class to minify both your javascript and css the best existing way (uglify-js for JS, clean-css for CSS) and if node is not available, PHP fallbacks are used instead., (*2)

Usage

First you need composer if you have not already. Then get the package with composer require nodejs-php-fallback/uglify then require the composer autload in your PHP file if it's not already:, (*3)

<?php

use NodejsPhpFallback\Uglify;

// Require the composer autoload in your PHP file if it's not already.
// You do not need to if you use a framework with composer like Symfony, Laravel, etc.
require 'vendor/autoload.php';

$uglify = new Uglify(array(
    'path/to/my-first-file.js',
    'path/to/my-second-file.js',
));
$uglify->add('path/to/my-thrid-file.js');

// Output to a file:
$uglify->write('path/to/destination.min.js');

// Output to the browser:
header('Content-type: text/javascript');
echo $uglify;

Uglify will use js minification by default. If the first source path end with .css or you use ->write() with a path ending with .css, it will switch to CSS mode. Else you can switch manually or get explicitly JS/CSS minified:, (*4)

$uglify->jsMode();
echo $uglify; // display minified javascript
$uglify->cssMode();
echo $uglify; // display minified css

// or
echo $uglify->getMinifiedJs(); // display minified javascript
echo $uglify->getMinifiedCss(); // display minified css

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure., (*5)

The Versions

07/09 2017

dev-master

9999999-dev

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

  Sources   Download

The Requires

 

The Development Requires

by Kyle

21/06 2017

1.0.3

1.0.3.0

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

  Sources   Download

The Requires

 

The Development Requires

by Kyle

21/06 2017

dev-kylekatarnls-default-path

dev-kylekatarnls-default-path

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

  Sources   Download

The Requires

 

The Development Requires

by Kyle

05/02 2017

1.0.2

1.0.2.0

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

  Sources   Download

The Requires

 

The Development Requires

by Kyle

29/07 2016

1.0.1

1.0.1.0

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

  Sources   Download

The Requires

 

The Development Requires

by Kyle

27/07 2016

1.0.0

1.0.0.0

PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

  Sources   Download

The Requires

 

The Development Requires

by Kyle