Login   Register  
PHP Classes
elePHPant
Icontem

File: obfusData

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of hwrProgs  >  nabiBust  >  obfusData  >  Download  
File: obfusData
Role: Example script
Content type: text/plain
Description: This is the executable file
Class: nabiBust
Obfuscate PHP code scripts
Author: By
Last change:
Date: 2010-01-30 03:55
Size: 5,142 bytes
 

Contents

Class file image Download
<?php
/**
 * Obfuscate Code.
 * Executable file.
 *
 */

// Tell NabiBust which classes and functions are system classes and functions and therefore can not 
// be obfuscated.
// All classes defined before these lines will be excluded from obfucation.
// Copy these three lines to a place where they are called before any
// user class or function definition.
require_once(realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.
"class_system_classes.php");
system_classes::init();

// USER SETTING: set maximum execution time
ini_set("max_execution_time",-1);

// init framework
require_once(realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR."obfuscator.php");
$settings = new ObfuscatorSettings();

//USER SETTING: set the source directory
$settings->set_source_directory(realpath(dirname(__FILE__)."/testfiles"));

// USER SETTING: set the target directory
$settings->set_target_directory(realpath(dirname(__FILE__)."/release"));

// USER SETTING: set file extensions to include
$settings->set_include_filenames(array("*.php"));

// USER SETTING: exclude from step 0 (copy files from source to target) folders that are not relevant for the project, 
// like the subversion folders ".svn" or the temp folders or files from Apple systems ".DS_*"
// and any files not needed.
// Theses folders and files will not show up in the result directory!
$settings->set_exclude_in_first_copy(array(    "*.svn*",
                                            
"*.DS_*".
                                            
"installation/test_and_build/test_installation",
                                            
"lib/obfuscate/release",
                                            
"lib/tar/install/install.gz"));

// USER SETTING: exclude directories that contain code which is supposed to be viewed or 
// changed by the user or contain foreign (unknown) code.
// These folders will show up in the result directory, but their contents will not be 
// obfuscated.
$settings->set_exclude_directories(array("modules""lib","not_to_obfuscate"));

// USER SETTING: exclude files that contain code which is supposed to be viewed or changed by 
// the user or contain foreign (unknown) code.
$settings->set_exclude_filenames(array("configuration.php","install_from_eclipse.php"));

// USER SETTING: set classes to be excluded, e.g. classes which are used in callbacks or in eval.
$settings->set_exclude_classes(array(
            
"receive_system_setting",
            
"will_be_checked",
            
"test_asset_static",
            
"color_editor",
            
"css_editor",
            
"font",
            
"link_editor",
            
"picture_editor",
            
"upload",
            
"del_warn",
            
"site_manager",
            
"change_permissions",
            
"secure_page_builder",
            
"show_page",
            
"save_position",
            
"save_size",
            
"set_virtual_group",
            
"template_copy_file",
            
"template_delete_file",
            
"template_editor",
            
"upload_tool",
            
"webdav",
            
"admin_frontend",
            
"group_assign",
            
"group_bean",
            
"nabidoo_example_bean",
            
"user_bean",
            
"requesting_user_bean",
            
"my_number_server",
            
"xhtml_converter",
            
"show_page",
            
"test_asset_dynamic",
            
"test_asset_static",
            
"input_checks",
            
"error_messages",
            
"group_to_group_assignment",
            
"single_site_manager",
            
"module_manager"));


// USER SETTING: set variables to be excluded, e.g. variables which are used in callbacks or in eval.
$settings->set_exclude_variables(array(    'content',
                                        
'template_call',
                                        
'user_email',
                                        
'user_first_name',
                                        
'user_last_name',
                                        
'group_name',
                                        
'source_group',
                                        
'target_group',
                                        
'user_password',
                                        
'userid',
                                        
'useremail',
                                        
'userfirstname',
                                        
'userlastname',
                                        
'group_name',
                                        
'page'));

// USER SETTING: set functions to be excluded, e.g. functions which are used in callbacks or in eval.
$settings->set_exclude_functions(array(    'run',
                                        
'run_unprotected',
                                        
'integer',
                                        
'html_hex_color_with_selection',
                                        
'real_integer',
                                        
'get_table_def',
                                        
'get_table',
                                        
'ucd',
                                        
'postprocess_delete',
                                        
'postprocess_ne',
                                        
'postprocess_edit',
                                        
'image_file_name_with_selection',
                                        
'secure_render_template',
                                        
'close_singleton_callback',
                                        
'add_hyphens_callback',
                                        
'filter_dangerous_code',
                                        
'is_unknown_modifier',
                                        
'strtolower',
                                        
'add_key',
                                        
'style_key_sort',
                                        
'integer',
                                        
'check_field',
                                        
'input_error_functions'));

// USER SETTING: set the required obfuscation steps 
$settings->set_steps(array(    ObfuscatorSettings::STEP_1_COPY,
                            
ObfuscatorSettings::STEP_2_CLASSES,
                            
ObfuscatorSettings::STEP_3_CONSTANTS,
                            
ObfuscatorSettings::STEP_4_COMMENTS,
                            
ObfuscatorSettings::STEP_5_VARIABLES,
                            
ObfuscatorSettings::STEP_6_FUNCTIONS,
                            
ObfuscatorSettings::STEP_7_WHITESPACES,
                            
ObfuscatorSettings::STEP_8
                            
));

                            
// NO MORE USER SETTINGS AFTER THIS LINE
// use this two lines to call the obfuscator
                            
$obfuscator = new Obfuscator($settings);
// start obfuscation process
$obfuscator->bust_files();
?>