What is the PHP bytecode Compiler?
Hi folks,
After completing some basic part of coding in PHP programming language, I have now turned to the compiler part of PHP. Since, I am new to this topic I don't have enough knowledge about it. So thought to ask the query to you guys, since you explain anything very neatly.!! Please tell me what is the PHP bytecode Compiler? Since I am new please provide me the detailed information.!! :rolleyes:
Re: What is the PHP bytecode Compiler?
PHP bytecode Compiler is also known as Bcompiler. Bcompiler has been written for various reasons, some of them are as follows :
- To encode entire script in a proprietary PHP application
- To encode some functions / classes in a proprietary PHP application
- To enable the production of php-gtk applications that can be used in desktop applications, without needing a php.exe.
- To make the transition easily from PHP to C
The paragraph on code protection is somewhat misleading. While it is correct that the exact source code can not be recreated this does not offer anything in terms of code protection people into a false sense of security.
Re: What is the PHP bytecode Compiler?
There are many scenarios where it is better to use the BCompiler. The first reason is possible using the functions bcompiler_write_header (), bcompiler_write_file () and bcompiler_write_footer (). Bytecode files can be compressed or not messages. To use the generated bytecode, you can simply include it with instructions to include or require. The second possible reason is using the functions bcompiler_write_header (), bcompiler_write_class (), bcompiler_write_footer (), bcompiler_read (), and bcompiler_load (). Bytecode files can be compressed or not written. The function bcompiler_load () reads the compressed bytecode , which represents one third the size of the original file.
Re: What is the PHP bytecode Compiler?
To create EXE type files, bcompiler must be used with a modified sapi file or a version of PHP has been compiled as a shared library. In this case, bcompiler reads the compressed bytecode from the end of the EXE. Bcompiler can improve performance by about 30% when using uncompressed bytecodes only. But keep in mind that uncompressed bytecode can be a size 5 times larger than the original source code. Using compressed bytecode take less space, but the relief requires more time to analyze the source code. Also, does Bcompiler any bytecode optimization.From a viewpoint of protection of code, we can say that it is absolutely impossible to recreate the exact source code, such as origin, and without the original comments. However, it is possible to recover data from a file bytecode Bcompiler - thus include not only your personal passwords.
Re: What is the PHP bytecode Compiler?
The following are functions of the bcompiler, along with the short description :
- bcompiler_load_exe - Reads and creates classes from a bcompiler exe
- bcompiler_load - Reads and creates classes from a file compressed in bzip2
- bcompiler_parse_class - Reads the bytecodes of a class and returned to a user function
- bcompiler_read - Reads and creates classes from a filehandle
- bcompiler_write_class - Writes an defined class as bytecodes
- bcompiler_write_constant - Writes a defined constant as bytecodes
Re: What is the PHP bytecode Compiler?
I am providing you with some more functions of the bcompiler, that can be useful for you while doing the coding :
- bcompiler_write_file - Writes a php source file as bytecodes
- bcompiler_write_footer - Writes the single character \ x00 to indicate End of compiled data
- bcompiler_write_function - Writes an defined function as bytecodes
- bcompiler_write_functions_from_file - Writes all functions defined in a file as bytecodes
- bcompiler_write_header - Writes the header bcompiler
- bcompiler_write_included_filename - Writes an included file as bytecodes