Show
Ignore:
Timestamp:
02/09/2008 12:23:27 AM (11 months ago)
Author:
PugFish
Message:

Converted comments for media module

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/media/libraries/JavaScriptPacker.php

    r1766 r2006  
    11<?php 
    2 /* 7 December 2006. version 1.0 
    3  *  
     2/** 
     3 * @package  Media Module 
     4 * 
     5 * $Id$ 
     6 * 
     7 * 7 December 2006. version 1.0 
     8 * 
    49 * This is the php version of the Dean Edwards JavaScript 's Packer, 
    510 * Based on : 
    6  *  
     11 * 
    712 * ParseMaster, version 1.0.2 (2005-08-19) Copyright 2005, Dean Edwards 
    813 * a multi-pattern parser. 
    914 * KNOWN BUG: erroneous behavior when using escapeChar with a replacement 
    1015 * value that is a function 
    11  *  
     16 * 
    1217 * packer, version 2.0.2 (2005-08-19) Copyright 2004-2005, Dean Edwards 
    13  *  
     18 * 
    1419 * License: http://creativecommons.org/licenses/LGPL/2.1/ 
    15  *  
     20 * 
    1621 * Ported to PHP by Nicolas Martin. 
    17  *  
     22 * 
    1823 * ---------------------------------------------------------------------- 
    19  *  
     24 * 
    2025 * examples of usage : 
    2126 * $myPacker = new JavaScriptPacker($script, 62, true, false); 
    2227 * $packed = $myPacker->pack(); 
    23  *  
     28 * 
    2429 * or 
    25  *  
     30 * 
    2631 * $myPacker = new JavaScriptPacker($script, 'Normal', true, false); 
    2732 * $packed = $myPacker->pack(); 
    28  *  
     33 * 
    2934 * or (default values) 
    30  *  
     35 * 
    3136 * $myPacker = new JavaScriptPacker($script); 
    3237 * $packed = $myPacker->pack(); 
    33  *  
    34  *  
     38 * 
     39 * 
    3540 * params of the constructor : 
    3641 * $script:       the JavaScript to pack, string. 
     
    4348 *                in the script, boolean. 
    4449 *                default: false. 
    45  *  
     50 * 
    4651 * The pack() method return the compressed JavasScript, as a string. 
    47  *  
     52 * 
    4853 * see http://dean.edwards.name/packer/usage/ for more information. 
    49  *  
     54 * 
    5055 * Notes : 
    5156 * # need PHP 5 . Tested with PHP 5.1.2 
    52  *  
     57 * 
    5358 * # The packed result may be different than with the Dean Edwards 
    5459 *   version, but with the same length. The reason is that the PHP 
     
    5863 *   ECMAScript standard). So the encoded keywords order can be 
    5964 *   different in the two results. 
    60  *  
     65 * 
    6166 * # Be careful with the 'High ASCII' Level encoding if you use 
    62  *   UTF-8 in your files...  
     67 *   UTF-8 in your files... 
    6368 */ 
    6469 
     
    8792                        $_encoding = $this->LITERAL_ENCODING[$_encoding]; 
    8893                $this->_encoding = min((int)$_encoding, 95); 
    89                 $this->_fastDecode = $_fastDecode;       
     94                $this->_fastDecode = $_fastDecode; 
    9095                $this->_specialChars = $_specialChars; 
    9196        } 
     
    253258                        // the ECMAscript standard does not guarantee this behaviour, 
    254259                        // and thus not all browsers (e.g. Mozilla versions dating back to at 
    255                         // least 2003) respect this.  
     260                        // least 2003) respect this. 
    256261                        usort($unsorted, array(&$this, '_sortWords')); 
    257262                        $j = 0; 
     
    434439                if (defined('self::JSFUNCTION'.$aName)) 
    435440                        return constant('self::JSFUNCTION'.$aName); 
    436                 else  
     441                else 
    437442                        return ''; 
    438443        } 
     
    530535    return ($charCode < _encoding ? \'\' : arguments.callee($charCode / _encoding)) + 
    531536        String.fromCharCode($charCode % _encoding + 161); 
    532 }';  
     537}'; 
    533538 
    534539}