bcompiler php,BCompiler PHP 字节码编译器

警告

本扩展模块是实验性的。本模块的行为,包括其函数的名称以及其它任何关于此模块的文档可能会在没有通知的情况下随

PHP 以后的发布而改变。使用本扩展模块风险自担。

Bcompiler was written for several reasons:

To encode entire script in a proprietary PHP application

To encode some classes and/or functions 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_file() and

bcompiler_write_footer()

functions. The bytecode files can

be written as either uncompressed or plain.

To use the generated bytecode, you can simply include it

with include or require statements.

The second 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 can improve performance by about 30% when used with uncompressed

bytecodes only. But keep in mind that uncompressed bytecode can be up

to 5 times larger than the original source code. Using bytecode

compression can save your space, but decompression requires much more

time than parsing a source. bcompiler 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值