From 3c3dbdd75c509c7e2bc12d0819b77aa548bd73cc Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Tue, 11 Dec 2007 06:49:01 +0000 Subject: [PATCH] MFB: Upgrade to the new-reference-structure - Moved the intro from reference.xml to book.xml - Change the intro ID to intro. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@247969 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/bcompiler/book.xml | 94 +++++++++++++++++++++++++++++ reference/bcompiler/constants.xml | 28 +++++++++ reference/bcompiler/reference.xml | 98 ++++++------------------------- reference/bcompiler/setup.xml | 45 ++++++++++++++ 4 files changed, 184 insertions(+), 81 deletions(-) create mode 100644 reference/bcompiler/book.xml create mode 100644 reference/bcompiler/constants.xml create mode 100644 reference/bcompiler/setup.xml diff --git a/reference/bcompiler/book.xml b/reference/bcompiler/book.xml new file mode 100644 index 0000000000..d0c47365a3 --- /dev/null +++ b/reference/bcompiler/book.xml @@ -0,0 +1,94 @@ + + + + + + + + PHP bytecode Compiler + bcompiler + + + &reftitle.intro; + &warn.experimental; + + 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. + + + + &reference.bcompiler.setup; + &reference.bcompiler.constants; + &reference.bcompiler.reference; + + + + + diff --git a/reference/bcompiler/constants.xml b/reference/bcompiler/constants.xml new file mode 100644 index 0000000000..609db829af --- /dev/null +++ b/reference/bcompiler/constants.xml @@ -0,0 +1,28 @@ + + + + + &reftitle.constants; + &no.constants; + + + + diff --git a/reference/bcompiler/reference.xml b/reference/bcompiler/reference.xml index 37d24cd3b6..d7cb1cfa81 100644 --- a/reference/bcompiler/reference.xml +++ b/reference/bcompiler/reference.xml @@ -1,89 +1,24 @@ - - - - + - - PHP bytecode Compiler - bcompiler + + bcompiler &Functions; + +
+ Contact Information + + If you have comments, bugfixes, enhancements or want to help + developing this beast, you can drop me a mail at alan_k@php.net. Any help is very + welcome. + +
+
- -
- &reftitle.intro; - &warn.experimental; - - 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. - -
+ &reference.bcompiler.entities.functions; - &reference.bcompiler.configure; +
-
- Contact Information - - If you have comments, bugfixes, enhancements or want to help - developing this beast, you can drop me a mail at alan_k@php.net. Any help is very - welcome. - -
- - - -&reference.bcompiler.entities.functions; - -
+ diff --git a/reference/bcompiler/setup.xml b/reference/bcompiler/setup.xml new file mode 100644 index 0000000000..b20b4cac41 --- /dev/null +++ b/reference/bcompiler/setup.xml @@ -0,0 +1,45 @@ + + + + + &reftitle.setup; + +
+ &reftitle.required; + &no.requirement; +
+ + &reference.bcompiler.configure; + +
+ &reftitle.runtime; + &no.config; +
+ +
+ &reftitle.resources; + &no.resource; +
+ +
+ + +