PHP 클래스 Minify_JS_ClosureCompiler, minify

저자: Stephen Clay ([email protected])
파일 보기 프로젝트 열기: mrclay/minify 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$additionalOptions string[] Additional options to pass to the compiler service
$fallbackMinifier Function to minify JS if service fails. Default is JSMin
$maxBytes integer The maximum JS size that can be sent to the compiler server in bytes
$serviceUrl string

공개 메소드들

메소드 설명
__construct ( array $options = [] )
min ( string $js ) : string Call the service to perform the minification
minify ( string $js, array $options = [] ) : string Minify JavaScript code via HTTP request to a Closure Compiler API

보호된 메소드들

메소드 설명
buildPostBody ( string $js, boolean $returnErrors = false ) : string Build a POST request body
getResponse ( string $postBody ) : string Get the response for a given POST body

메소드 상세

__construct() 공개 메소드

public __construct ( array $options = [] )
$options array Options with keys available below: fallbackFunc : (callable) function to minify if service unavailable. Default is JSMin. compilerUrl : (string) URL to closure compiler server maxBytes : (int) The maximum amount of bytes to be sent as js_code in the POST request. Defaults to 200000. additionalParams : (string[]) Additional parameters to pass to the compiler server. Can be anything named in https://developers.google.com/closure/compiler/docs/api-ref except for js_code and output_info

buildPostBody() 보호된 메소드

Build a POST request body
protected buildPostBody ( string $js, boolean $returnErrors = false ) : string
$js string JavaScript code
$returnErrors boolean
리턴 string

getResponse() 보호된 메소드

Get the response for a given POST body
protected getResponse ( string $postBody ) : string
$postBody string
리턴 string

min() 공개 메소드

Call the service to perform the minification
public min ( string $js ) : string
$js string JavaScript code
리턴 string

minify() 공개 정적인 메소드

Minify JavaScript code via HTTP request to a Closure Compiler API
public static minify ( string $js, array $options = [] ) : string
$js string input code
$options array Options passed to __construct(). @see __construct
리턴 string

프로퍼티 상세

$additionalOptions 보호되어 있는 프로퍼티

Additional options to pass to the compiler service
protected string[] $additionalOptions
리턴 string[]

$fallbackMinifier 보호되어 있는 프로퍼티

Function to minify JS if service fails. Default is JSMin
protected $fallbackMinifier

$maxBytes 보호되어 있는 프로퍼티

The maximum JS size that can be sent to the compiler server in bytes
protected int $maxBytes
리턴 integer

$serviceUrl 보호되어 있는 프로퍼티

protected string $serviceUrl
리턴 string