PHP Classes

File: phpJSO.example.php

Recommend this page to a friend!
  Classes of Noor Dawod   Javascript Obfuscator   phpJSO.example.php   Download  
File: phpJSO.example.php
Role: Example script
Content type: text/plain
Description: An example PHP script
Class: Javascript Obfuscator
Obfuscate a Javascript source code
Author: By
Last change:
Date: 20 years ago
Size: 1,879 bytes
 

Contents

Class file image Download
<?php

 
/**
   * phpJSO - A JavaScript Obfuscator written in PHP.
   * Copyright © COMRAX® Ltd. All rights reserved.
   * Unauthorized duplication and modification prohibited.
   *
   * END-USER LICENSE AND AGREEMENT
   * THIS SOFTWARE IS PROVIDED BY "COMRAX LTD" ``AS IS'' AND ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   * IN NO EVENT SHALL "COMRAX LTD" BE LIABLE FOR ANY DIRECT, INDIRECT,
   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND true ANY
   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

  /// Include phpJSO main class file.
 
require_once( 'phpJSO.class.php' );

 
/// Source file to be obfuscated.
 
ob_start( );
 
readfile( 'phpJSO.example.js' );
 
$javascriptCode = ob_get_contents( );
 
ob_end_clean( );

 
/// Instantiate a new phpJSO object.
 
$jso = new phpJSO( );

 
/// Point to the source code using a referenced variable.
 
$jso->setSourceCodeByRef( $javascriptCode );

 
/// Process source code and get back obfuscated code.
 
$obfuscatedCode =& $jso->getObfuscatedCode( );

 
/// Free memory.
 
$jso->freeMemory( );
 
$jso = null;

 
/// Output obfuscated code.
 
echo $obfuscatedCode;



 
/**
   * DON'T ADD ANY CLOSING TAG OR CODE HENCEFORTH!
   *
   * PHP ENGINE AUTOMATICALLY STOPS PARSING AT END
   * OF SCRIPT, EVEN IF NO CLOSING TAG IS PRESENT.
  */