StylesheetCompressor
class StylesheetCompressor
Properties
protected string[] | $deduplicateTargets | ||
protected array | $dictionary | ||
protected string | $keyPrefix | ||
int | $minSaving | ||
protected array | $savings | ||
protected string | $xsl |
Methods
Encode given stylesheet into a compact JavaScript representation
Build a dictionary of all cost-effective string replacements
Estimate the savings of every possible string replacement
Filter the savings according to the minSaving property
Return all the possible dictionary keys that are not present in the original stylesheet
Return the stylesheet after dictionary replacements
Return a list of possible dictionary keys
Return a regexp that matches all used dictionary keys
Return the frequency of all deduplicatable strings
Return the list of possible dictionary keys that appear in the original stylesheet
Details
at line 66
string
encode(string $xsl)
Encode given stylesheet into a compact JavaScript representation
at line 93
protected void
buildDictionary()
Build a dictionary of all cost-effective string replacements
at line 117
protected void
estimateSavings()
Estimate the savings of every possible string replacement
at line 136
protected void
filterSavings()
Filter the savings according to the minSaving property
at line 152
protected string[]
getAvailableKeys()
Return all the possible dictionary keys that are not present in the original stylesheet
at line 162
protected string
getCompressedStylesheet()
Return the stylesheet after dictionary replacements
at line 172
protected string[]
getPossibleKeys()
Return a list of possible dictionary keys
at line 188
protected string
getReplacementRegexp()
Return a regexp that matches all used dictionary keys
at line 198
protected array
getStringsFrequency()
Return the frequency of all deduplicatable strings
at line 211
protected string[]
getUnavailableKeys()
Return the list of possible dictionary keys that appear in the original stylesheet