\Horde_JavascriptMinify

Abstract base class for implementing a javascript minification driver.

Summary

Methods
Properties
Constants
__construct()
__toString()
setOptions()
minify()
sourcemap()
No public properties found
No constants found
_sourceUrls()
$_data
$_opts
$_sourcemap
N/A
No private methods found
No private properties found
N/A

Properties

$_data

$_data : mixed

Original javascript data.

Type

mixed

$_opts

$_opts : array

Minification options.

Type

array

$_sourcemap

$_sourcemap : string

Temporary file containing sourcemap data.

Type

string

Methods

__construct()

__construct(mixed  $js, array  $opts = array()) 

Constructor.

Parameters

mixed $js

Either a string (the JS text to compress) or an array of URLs (keys) to filenames (values) containing the JS data to compress.

array $opts

Additional options. See setOptions().

__toString()

__toString() 

setOptions()

setOptions(array  $opts = array()) 

Set minification options.

Parameters

array $opts

Options:

  - logger: (Horde_Log_Logger) Log object to use for log messages.

minify()

minify() : string

Return the minified javascript.

Throws

\Horde_JavascriptMinify_Exception

Returns

string —

Minified javascript.

sourcemap()

sourcemap() : mixed

Returns the sourcemap data.

Only supported if javascript is data is provided via web-accessible static files. minify() must be called before this method will return any data.

Returns

mixed —

The sourcemap data, or null if it doesn't exist.

_sourceUrls()

_sourceUrls() : string

Creates a list of source comments linking to the original URLs of the source files.

Needed in minification files to ensure that all license terms of the minified code (which may have been removed during the minification process) are accessible.

Returns

string —

Source URL data.