$input
$input : string
The input javascript to be minified.
Minifier
Usage - Minifier::minify($js); Usage - Minifier::minify($js, $options); Usage - Minifier::minify($js, array('flaggedComments' => false));
$input : string
The input javascript to be minified.
$index : int
The location of the character (in the input string) that is next to be processed.
$a : string
The first of the characters currently being looked at.
$b : string
The next character being looked at (after a);
$options : array
Contains the options for the current minification process.
$defaultOptions : array
Contains the default options for minification. This array is merged with the one passed in by the user to create the request specific set of options (stored in the $options attribute).
$locks : array
Contains lock ids which are used to replace certain code patterns and prevent them from being minified
minify(string $js, array $options = array()) : bool|string
Takes a string containing javascript and removes unneeded characters in order to shrink the code without altering it's functionality.
string | $js | The raw javascript to be minified |
array | $options | Various runtime options in an associative array |
minifyDirectToOutput(string $js, array $options) : mixed
Processes a javascript string and outputs only the required characters, stripping out all unneeded characters.
string | $js | The raw javascript to be minified |
array | $options | Various runtime options in an associative array |
getReal() : string
This function gets the next "real" character. It is essentially a wrapper around the getChar function that skips comments. This has significant performance benefits as the skipping is done using native functions (ie, c code) rather than in script php.
Next 'real' character to be processed.
processMultiLineComments(int $startIndex) : bool|string
Skips multiline comments where appropriate, and includes them where needed.
Conditional comments and "license" style blocks are preserved.
int | $startIndex | The index point where "getReal" function started |
Unclosed comments will throw an error
False if there's no character
getNext(string $string) : string|false
Pushes the index ahead to the next instance of the supplied string. If it is found the first character of the string is returned and the index is set to it's position.
string | $string |
Returns the first character of the string or false.