mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 18:38:55 +00:00

- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
105 lines
3.9 KiB
XML
105 lines
3.9 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- Purpose: basic.php -->
|
|
<!-- Membership: pecl -->
|
|
<!-- State: experimental -->
|
|
|
|
<reference xml:id="ref.bcompiler" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<title>PHP bytecode Compiler</title>
|
|
<titleabbrev>bcompiler</titleabbrev>
|
|
|
|
<partintro>
|
|
<section xml:id="bcompiler.intro">
|
|
&reftitle.intro;
|
|
&warn.experimental;
|
|
<para>
|
|
Bcompiler was written for several reasons:
|
|
<simplelist>
|
|
<member>To encode entire script in a proprietary PHP application</member>
|
|
<member>To encode some classes and/or functions in a proprietary PHP application</member>
|
|
<member>
|
|
To enable the production of php-gtk applications that could be used on
|
|
client desktops, without the need for a php.exe.
|
|
</member>
|
|
<member>To do the feasibility study for a PHP to C converter</member>
|
|
</simplelist>
|
|
The first of these goals is achieved using the
|
|
<function>bcompiler_write_header</function>,
|
|
<function>bcompiler_write_file</function> and
|
|
<function>bcompiler_write_footer</function>
|
|
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.
|
|
</para>
|
|
<para>
|
|
The second of these goals is achieved using the
|
|
<function>bcompiler_write_header</function>,
|
|
<function>bcompiler_write_class</function>,
|
|
<function>bcompiler_write_footer</function>,
|
|
<function>bcompiler_read</function>,
|
|
and <function>bcompiler_load</function> functions. The bytecode files can
|
|
be written as either uncompressed or plain. The
|
|
<function>bcompiler_load</function> reads a bzip compressed bytecode file,
|
|
which tends to be 1/3 of the size of the original file.
|
|
</para>
|
|
<para>
|
|
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.
|
|
</para>
|
|
<para>
|
|
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...
|
|
</para>
|
|
<para>
|
|
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.
|
|
</para>
|
|
</section>
|
|
|
|
&reference.bcompiler.configure;
|
|
|
|
<section xml:id="bcompiler.contact">
|
|
<title>Contact Information</title>
|
|
<para>
|
|
If you have comments, bugfixes, enhancements or want to help
|
|
developing this beast, you can drop me a mail at <link
|
|
xlink:href="mailto:alan_k@php.net">alan_k@php.net</link>. Any help is very
|
|
welcome.
|
|
</para>
|
|
</section>
|
|
|
|
</partintro>
|
|
|
|
&reference.bcompiler.functions;
|
|
|
|
</reference>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|