\Horde_JavascriptMinify_Closure

Google Closure Compiler minification driver.

Summary

Methods
Properties
Constants
minify()
__construct()
__toString()
setOptions()
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

minify()

minify() : string

Return the minified javascript.

Returns

string —

Minified javascript.

__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()) 

Parameters

array $opts

Driver specific options:

  - closure: (string) [REQUIRED] Path to the Closure compiler.
  - cmdline: (string) Command line arguments to use.
  - java: (string) [REQUIRED] Path to the java binary.
  - sourcemap: (string) The URL to the web-accessible location the
               sourcemap file will be stored at.

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.