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..