gino CMS  2.5.0
gino è un CMS scritto in PHP che offre tutti gli strumenti necessari per poter creare un sito web e gestire i contenuti al suo interno in maniera semplice ed efficace, svincolando l'amministratore da conoscenze tecniche di programmazione
JSMin Class Reference

PHP implementation of Douglas Crockford's JSMin. More...

Public Member Functions

 __construct ($input)
 Constructor. More...
 

Static Public Member Functions

static minify ($js)
 Minify Javascript. More...
 

Data Fields

const ORD_LF = 10
 
const ORD_SPACE = 32
 
const ACTION_KEEP_A = 1
 
const ACTION_DELETE_A = 2
 
const ACTION_DELETE_A_B = 3
 

Protected Member Functions

 action ($command)
 Action – do something! What to do is determined by the $command argument. More...
 
 get ()
 Get next char. More...
 
 isAlphaNum ($c)
 Is $c a letter, digit, underscore, dollar sign, or non-ASCII character. More...
 
 min ()
 Perform minification, return result. More...
 
 next ()
 Get the next character, skipping over comments. More...
 
 peek ()
 Get next char. More...
 

Protected Attributes

 $a = ''
 
 $b = ''
 
 $input = ''
 
 $inputIndex = 0
 
 $inputLength = 0
 
 $lookAhead = null
 
 $output = ''
 

Detailed Description

PHP implementation of Douglas Crockford's JSMin.

This is pretty much a direct port of jsmin.c to PHP with just a few PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and outputs to stdout, this library accepts a string as input and returns another string as output.

PHP 5 or higher is required.

Permission is hereby granted to use this version of the library under the same terms as jsmin.c, which has the following license:


Copyright (c) 2002 Douglas Crockford (www.crockford.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The Software shall be used for Good, not Evil.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

Author
Ryan Grove ryan@.nosp@m.wonk.nosp@m.o.com
Version
1.1.2 (2012-05-01) https://github.com/rgrove/jsmin-php

Constructor & Destructor Documentation

__construct (   $input)

Constructor.

Parameters
string$inputJavascript to be minified

Member Function Documentation

action (   $command)
protected

Action – do something! What to do is determined by the $command argument.

action treats a string as a single character. Wow! action recognizes a regular expression if it is preceded by ( or , or =.

next() get()

Exceptions
JSMinExceptionIf parser errors are found:
  • Unterminated string literal
  • Unterminated regular expression set in regex literal
  • Unterminated regular expression literal
Parameters
int$commandOne of class constants: ACTION_KEEP_A Output A. Copy B to A. Get the next B. ACTION_DELETE_A Copy B to A. Get the next B. (Delete A). ACTION_DELETE_A_B Get the next B. (Delete B).
get ( )
protected

Get next char.

Convert ctrl char to space.

Returns
string|null
isAlphaNum (   $c)
protected

Is $c a letter, digit, underscore, dollar sign, or non-ASCII character.

Returns
bool
min ( )
protected

Perform minification, return result.

action() isAlphaNum() get() peek()

Returns
string
static minify (   $js)
static

Minify Javascript.

__construct() min()

Parameters
string$jsJavascript to be minified
Returns
string
next ( )
protected

Get the next character, skipping over comments.

peek() is used to see if a '/' is followed by a '/' or '*'.

get() peek()

Exceptions
JSMinExceptionOn unterminated comment.
Returns
string
peek ( )
protected

Get next char.

If is ctrl character, translate to a space or newline.

get()

Returns
string|null

Field Documentation

$a = ''
protected
$b = ''
protected
$input = ''
protected
$inputIndex = 0
protected
$inputLength = 0
protected
$lookAhead = null
protected
$output = ''
protected
const ACTION_DELETE_A = 2
const ACTION_DELETE_A_B = 3
const ACTION_KEEP_A = 1
const ORD_LF = 10
const ORD_SPACE = 32

The documentation for this class was generated from the following file: