OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 
PHP bytecode Compiler

II. PHP bytecode Compiler

Warning

This module is EXPERIMENTAL. That means that the behaviour of these functions, these function names, in concreto ANYTHING documented here can change in a future release of this package WITHOUT NOTICE. Be warned, and use this module at your own risk.

Introduction

About bcompiler

Bcompiler was written for two reasons:

To encode some classes in a proprietary php application
To enable the production of php-gtk applications that could be used on client desktops, without the need for a php.exe.
To do the feasibility study for a PHP to C converter

The first of these goals is achieved using the bcompiler_write_header, bcompiler_write_class, bcompiler_write_footer, bcompiler_read, and bcompiler_load functions. The bytecode files can be written as either uncompressed or plain. The bcompiler_load reads a bzip compressed bytecode file, which tends to be 1/3 of the size of the original file.

To create EXE type files, bcompiler has to be used with a modified sapi file or a version of php which has been compiled as a shared library. In this scenario, bcompiler reads the compressed bytecode from the end of the exe file.

bcompiler is unlikely to improve performance very much, as it only bypasses the compiler stage of the php running process and replaces it with the import process in bcompiler. It also does not do any bytecode optimization, this could be added in the future...

in terms of code protection, it is safe to say that it would be impossible to recreate the exact source code that it was built from, and without the accompanying source code comments. It would effectively be useless to use the bcompiler bytecodes to recreate and modify a class. However it is possible to retrieve data from a bcompiled bytecode file - so don't put your private passwords or anything in it..

Installation

short installation note:

Table of Contents
bcompiler_write_class -- Writes an defined class as bytecodes
bcompiler_write_function -- Writes an defined function as bytecodes
bcompiler_write_constant -- Writes a defined constant as bytecodes
bcompiler_write_functions_from_file -- Writes all functions defined in a file as bytecodes
bcompiler_write_header -- Writes the bcompiler header
bcompiler_write_footer -- Writes the a single character \x00 to indicate End of compiled data
bcompiler_write_exe_footer -- Writes the the start pos, and sig to the end of a exe type file
bcompiler_read -- reads and creates classes from a filehandle
bcompiler_load -- reads and creates classes from a bz compressed file
bcompiler_load_exe -- reads and creates classes from a bcompiler exe file
bcompiler_parse_class -- reads the bytecodes of a class and calls back to a user function
 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting


Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS Free Templates

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005