Minify

JS extends Minify
in package

JavaScript Minifier Class.

Please report bugs on https://github.com/matthiasmullie/minify/issues

Tags
author

Matthias Mullie minify@mullie.eu

author

Tijs Verkoyen minify@verkoyen.eu

copyright

Copyright (c) 2012, Matthias Mullie. All rights reserved

license

MIT License

Table of Contents

Methods

__construct()  : mixed
Init the minify class - optionally, code may be passed along already.
add()  : static
Add a file or straight-up code to be minified.
addFile()  : static
Add a file to be minified.
cache()  : CacheItemInterface
Minify the data & write it to a CacheItemInterface object.
execute()  : string
Minify the data.
gzip()  : string
Minify & gzip the data & (optionally) saves it to a file.
minify()  : string
Minify the data & (optionally) saves it to a file.

Methods

__construct()

Init the minify class - optionally, code may be passed along already.

public __construct() : mixed

add()

Add a file or straight-up code to be minified.

public add(string|array<string|int, string> $data) : static
Parameters
$data : string|array<string|int, string>
Return values
static

addFile()

Add a file to be minified.

public addFile(string|array<string|int, string> $data) : static
Parameters
$data : string|array<string|int, string>
Tags
throws
IOException
Return values
static

cache()

Minify the data & write it to a CacheItemInterface object.

public cache(CacheItemInterface $item) : CacheItemInterface
Parameters
$item : CacheItemInterface

Cache item to write the data to

Return values
CacheItemInterface

Cache item with the minifier data

execute()

Minify the data.

public execute([mixed $path = null ]) : string

Perform JS optimizations.

Parameters
$path : mixed = null

Path to write the data to

Return values
string

The minified data

gzip()

Minify & gzip the data & (optionally) saves it to a file.

public gzip([mixed $path = null ][, mixed $level = 9 ]) : string
Parameters
$path : mixed = null

Path to write the data to

$level : mixed = 9

Compression level, from 0 to 9

Return values
string

The minified & gzipped data

minify()

Minify the data & (optionally) saves it to a file.

public minify([mixed $path = null ]) : string
Parameters
$path : mixed = null

Path to write the data to

Return values
string

The minified data


        
On this page

Search results