PHP Class Minify_HTML_Helper, minify

Author: Stephen Clay ([email protected])
显示文件 Open project: mrclay/minify Class Usage Examples

Public Properties

Property Type Description
$groupsConfigFile
$minAppUri
$rewriteWorks

Protected Properties

Property Type Description
$_filePaths ..
$_groupKey
$_lastModified

Public Methods

Method Description
app ( App $app = null ) : App
getLastModified ( array | string $sources, integer $lastModified ) : integer Get the max(lastModified) of all files
getRawUri ( boolean $farExpires = true, boolean $debug = false ) : string Get non-HTML-escaped URI to minify the specified files
getUri ( string | array $keyOrFiles, array $opts = [] ) : string Get an HTML-escaped Minify URI for a group or set of files
setFiles ( array $files, boolean $checkLastModified = true ) Set the files that will comprise the URI we're building
setGroup ( string $key, boolean $checkLastModified = true ) Set the group of files that will comprise the URI we're building

Protected Methods

Method Description
_getCommonCharAtPos ( array $arr, integer $pos ) : mixed In a given array of strings, find the character they all have at a particular index
_getShortestUri ( array $paths, string $minRoot = '/min/' ) : string Get the shortest URI to minify the set of source files

Method Details

_getCommonCharAtPos() protected static method

In a given array of strings, find the character they all have at a particular index
protected static _getCommonCharAtPos ( array $arr, integer $pos ) : mixed
$arr array array of strings
$pos integer index to check
return mixed a common char or '' if any do not match

_getShortestUri() protected static method

Get the shortest URI to minify the set of source files
protected static _getShortestUri ( array $paths, string $minRoot = '/min/' ) : string
$paths array root-relative URIs of files
$minRoot string root-relative URI of the "min" application
return string

app() public static method

public static app ( App $app = null ) : App
$app Minify\App
return Minify\App

getLastModified() public static method

Get the max(lastModified) of all files
public static getLastModified ( array | string $sources, integer $lastModified ) : integer
$sources array | string
$lastModified integer
return integer

getRawUri() public method

Get non-HTML-escaped URI to minify the specified files
public getRawUri ( boolean $farExpires = true, boolean $debug = false ) : string
$farExpires boolean
$debug boolean
return string

getUri() public static method

Get an HTML-escaped Minify URI for a group or set of files
public static getUri ( string | array $keyOrFiles, array $opts = [] ) : string
$keyOrFiles string | array a group key or array of filepaths/URIs
$opts array options: 'farExpires' : (default true) append a modified timestamp for cache revving 'debug' : (default false) append debug flag 'charset' : (default 'UTF-8') for htmlspecialchars 'minAppUri' : (default '/min') URI of min directory 'rewriteWorks' : (default true) does mod_rewrite work in min app? 'groupsConfigFile' : specify if different
return string

setFiles() public method

Set the files that will comprise the URI we're building
public setFiles ( array $files, boolean $checkLastModified = true )
$files array
$checkLastModified boolean

setGroup() public method

Set the group of files that will comprise the URI we're building
public setGroup ( string $key, boolean $checkLastModified = true )
$key string
$checkLastModified boolean

Property Details

$_filePaths protected_oe property

..
protected $_filePaths

$_groupKey protected_oe property

protected $_groupKey

$_lastModified protected_oe property

protected $_lastModified

$groupsConfigFile public_oe property

public $groupsConfigFile

$minAppUri public_oe property

public $minAppUri

$rewriteWorks public_oe property

public $rewriteWorks