Data Structures | Enumerations

Modules/Scorm2004/classes/JSMin_lib.php File Reference

Go to the source code of this file.

Data Structures

class  JSMinException
 Generic exception class related to JSMin. More...
class  FileOpenFailedJSMinException
 A JSMin exception indicating that a file provided for input or output could not be properly opened. More...
class  UnterminatedCommentJSMinException
 A JSMin exception indicating that an unterminated comment was encountered in input. More...
class  UnterminatedStringLiteralJSMinException
 A JSMin exception indicatig that an unterminated string literal was encountered in input. More...
class  UnterminatedRegExpLiteralJSMinException
 A JSMin exception indicatig that an unterminated regular expression lieteral was encountered in input. More...
class  JSMin
 Main JSMin application class. More...

Enumerations

enum  JSMIN_VERSION
 

JSMin_lib.php (for PHP 4, 5).

More...
enum  EOF
 

How fgetc() reports an End Of File.

More...
enum  ORD_NL
 

Some ASCII character ordinals.

More...
enum  ORD_space
enum  ORD_cA
enum  ORD_cZ
enum  ORD_a
enum  ORD_z
enum  ORD_0
enum  ORD_9
enum  JSMIN_ACT_FULL
 

Constant describing an action() : Output A.

More...
enum  JSMIN_ACT_BUF
 

Constant describing an action() : Copy B to A.

More...
enum  JSMIN_ACT_IMM
 

Constant describing an action() : Get the next B.

More...

Enumeration Type Documentation

enum EOF

How fgetc() reports an End Of File.

N.B. : use === and not == to test the result of fgetc() ! (see manual)

Definition at line 92 of file JSMin_lib.php.

Constant describing an action() : Copy B to A.

Get the next B. (Delete A).

Definition at line 156 of file JSMin_lib.php.

Constant describing an action() : Output A.

Copy B to A. Get the next B.

Definition at line 150 of file JSMin_lib.php.

Constant describing an action() : Get the next B.

(Delete B).

Definition at line 162 of file JSMin_lib.php.

JSMin_lib.php (for PHP 4, 5).

PHP adaptation of JSMin, published by Douglas Crockford as jsmin.c, also based on its Java translation by John Reilly.

Permission is hereby granted to use the PHP version under the same conditions as jsmin.c, which has the following notice :

----------------------------------------------------------------------------

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.

----------------------------------------------------------------------------

No new copyright ; please keep above and following information.

Author:
David Holmes <dholmes@cfdsoftware.net> of CFD Labs, France
Gaetano Giunta
Version:
Id:

Please note, this is a brutal and simple conversion : it could undoubtedly be improved, as a PHP implementation, by applying more PHP-specific programming features.

Exceptions and all PHP 5 - only features ahve been removed for compat with PHP 4

Note : whereas jsmin.c works specifically with the standard input and output streams, this implementation only falls back on them if file pathnames are not provided to the JSMin() constructor.

Examples comparing with the application compiled from jsmin.c :

jsmin < orig.js > mini.js JSMin.php orig.js mini.js JSMin.php orig.js > mini.js JSMin.php - mini.js < orig.js jsmin < orig.js JSMin.php orig.js JSMin.php orig.js - jsmin > mini.js JSMin.php - mini.js JSMin.php > mini.js jsmin comm1 comm2 < a.js > b.js JSMin.php a.js b.js comm1 comm2 JSMin.php a.js b.js -c comm1 comm2 JSMin.php a.js --comm comm1 comm2 > b.js JSMin.php -c comm1 comm2 < a.js > b.js (etc...)

See JSMin.php -h (or --help) for command-line documentation.

NEW AND IMPROVED in version 0.2: to take advantage of this file in your own code, you can do the following:

define('JSMIN_AS_LIB', true); // prevents auto-run on include include('jsmin.php'); // the JSMin class now works on php strings, too $jsMin = new JSMin(file_get_contents('e:/htdocs/awstats_misc_tracker.js'), false); // in that case, the modifies string is returned by minify(): $out = $jsMin->minify(); Version of this PHP translation.

Definition at line 85 of file JSMin_lib.php.

enum ORD_0

Definition at line 105 of file JSMin_lib.php.

enum ORD_9

Definition at line 106 of file JSMin_lib.php.

enum ORD_a

Definition at line 103 of file JSMin_lib.php.

enum ORD_cA

Definition at line 101 of file JSMin_lib.php.

enum ORD_cZ

Definition at line 102 of file JSMin_lib.php.

enum ORD_NL

Some ASCII character ordinals.

N.B. : PHP identifiers are case-insensitive !

Definition at line 99 of file JSMin_lib.php.

enum ORD_space

Definition at line 100 of file JSMin_lib.php.

enum ORD_z

Definition at line 104 of file JSMin_lib.php.