2017 © Pedro Peláez
 

project squeezer

PHP library minifier

image

mamuz/squeezer

PHP library minifier

  • Wednesday, February 3, 2016
  • by mamuz
  • Repository
  • 2 Watchers
  • 10 Stars
  • 954 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Squeezer

Author Build Status Coverage Status Quality Score Dependency Status, (*1)

Latest Stable Version Total Downloads License, (*2)

Squeezer is a minifier for php class files. It will parse your directories to find valid classes, interfaces and traits and squeeze them to one file. Autoloading in php is quite nice but also expensive. Sometimes too expensive for production. Using a minified file reduces the execution time of your application but increases the memory usage. Take care which directories or packages you want to squeeze. For production you should only squeeze used packages., (*3)

Installation

The recommended way to install mamuz/squeezer is through composer by adding dependency to your composer.json:, (*4)

{
    "require-dev": {
        "mamuz/squeezer": "0.*"
    }
}

Features

  • Minify classes, interfaces and traits to one compressed file.
  • Validates availability of class dependencies.
  • Removing comments and docblocks is optional to keep interoperability to annotation parser.
  • PHP files with more than one class, interface or trait declarations will be skipped.
  • PHP files with include, include_once, require or require_once statements will be skipped.
  • PHP files with function calls to handle files like fopen or mkdirwill be skipped.
  • PHP files with a declare statement will be skipped.

Usage

Run this command line to squeeze your library without comments to classes.min.php:, (*5)

./vendor/bin/squeeze classes.min.php --source="module/*/src, vendor/zendframework/*/src" --exclude="zend-loader" --nocomments

For instance, we are using a typical ZendFramework Application, but you can adapt this command to each environment, (*6)

After that you can include classes.min.php inside your index.php, but before loading composer autoloader., (*7)

For instance..., (*8)

//...
include_once 'classes.min.php';
include_once 'vendor/autoload.php'; // composer autoloader
//...

Use this command to get synopsis about all arguments, (*9)

./vendor/bin/squeeze --help

The Versions

03/02 2016

dev-master

9999999-dev https://github.com/mamuz/Squeezer

PHP library minifier

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Muths

performance minify improvement

03/02 2016

v0.2.1

0.2.1.0 https://github.com/mamuz/Squeezer

PHP library minifier

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Muths

performance minify improvement

21/07 2015

v0.2.0

0.2.0.0 https://github.com/mamuz/Squeezer

PHP library minifier

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Muths

performance minify improvement

05/07 2015

v0.1.2

0.1.2.0 https://github.com/mamuz/Squeezer

PHP library minifier

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Muths

performance minify improvement

02/07 2015

v0.1.1

0.1.1.0 https://github.com/mamuz/Squeezer

PHP library minifier

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Muths

performance minify improvement

29/06 2015