PHP Class Horde_JavascriptMinify, horde

Author: Michael Slusarz ([email protected])
ファイルを表示 Open project: horde/horde

Protected Properties

Property Type Description
$_data mixed Original javascript data.
$_opts array Minification options.
$_sourcemap string Temporary file containing sourcemap data.

Public Methods

Method Description
__construct ( mixed $js, array $opts = [] ) Constructor.
__toString ( )
minify ( ) : string Return the minified javascript.
setOptions ( array $opts = [] ) Set minification options.
sourcemap ( ) : mixed Returns the sourcemap data.

Protected Methods

Method Description
_sourceUrls ( ) : string Creates a list of source comments linking to the original URLs of the source files.

Method Details

__construct() public method

Constructor.
public __construct ( mixed $js, array $opts = [] )
$js mixed Either a string (the JS text to compress) or an array of URLs (keys) to filenames (values) containing the JS data to compress.
$opts array Additional options. See setOptions().

__toString() public method

See also: Horde_JavascriptMinify::minify()
public __toString ( )

_sourceUrls() protected method

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.
Since: 1.1.0
protected _sourceUrls ( ) : string
return string Source URL data.

minify() abstract public method

Return the minified javascript.
abstract public minify ( ) : string
return string Minified javascript.

setOptions() public method

Set minification options.
public setOptions ( array $opts = [] )
$opts array Options:
  - logger: (Horde_Log_Logger) Log object to use for log messages.

sourcemap() public method

Only supported if javascript is data is provided via web-accessible static files. minify() must be called before this method will return any data.
public sourcemap ( ) : mixed
return mixed The sourcemap data, or null if it doesn't exist.

Property Details

$_data protected_oe property

Original javascript data.
protected mixed $_data
return mixed

$_opts protected_oe property

Minification options.
protected array $_opts
return array

$_sourcemap protected_oe property

Temporary file containing sourcemap data.
protected string $_sourcemap
return string