Download the PHP package lastzero/css-optimizer without Composer

On this page you can find all versions of the php package lastzero/css-optimizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package css-optimizer

CSS Optimizer for PHP

Build Status Latest Stable Version License

Minifies stylesheets by removing duplicates and combining selectors - mostly safe and very efficient. This package was developed as a "quick win" to optimize the CSS of an existing commercial Web site, as the CSS contained many duplicates and similar selectors created by a CSS precompiler. It was published in the hope to help others in the same situation.

Note: The optimization is performed using simple (and fast) string functions - it's not a real CSS parser. It requires well formed CSS without inline comments (don't worry, you can use the minifyCss() method for that, see usage).

Warning: The order of selectors in your CSS does play a role and the "further down" one does in fact win when the specificity values are exactly the same. If your CSS relies on order to work, this optimization will obviously break it. See also https://en.wikipedia.org/wiki/Cascading_Style_Sheets#Specificity

Input:

body { foo:bar; too: me; } 
body { baz:foo; }
body { foo: new }
div.test { border: 1px solid black; }
div.other { border: 1px solid black}

Output:

body{baz:foo;foo:new;too:me}div.other,div.test{border:1px solid black}

Usage:

$optimizer = new \CssOptimizer\Css\Optimizer;

$inputCss = 'body { foo:bar; too: me;} body { baz:foo; } body { foo: new }
div.test { border: 1px solid black; }
div.other { border: 1px solid black} ';

$minifiedCss = $optimizer->minifyCss($inputCss);
$optimizedCss = $optimizer->optimizeCss($minifiedCss);

print_r($optimizer->getCounts());

Assetic filter

This library comes with a ready-to-use Assetic filter (for Symfony2). Please use a pre-filter like CssMinFilter.

Usage:

$filter = new \CssOptimizer\Assetic\Filter\CssOptimizeFilter;
$asset = new StringAsset($inputCss);
$asset->ensureFilter($filter);
$outputCss = $asset->dump();

Composer

If you are using composer, simply add "lastzero/css-optimizer" to your composer.json file and run composer update:

"require": {
    "lastzero/css-optimizer": "*"
}

All versions of css-optimizer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
natxet/cssmin Version dev-master
kriswallsmith/assetic Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lastzero/css-optimizer contains the following files

Loading the files please wait ....