recent searches:
searching include ,
searching variable ,
searching post...
| Ostrzeżenie |
Ten moduł jest w stadium EKSPERYMENTALNYM. Oznacza to, że zachowanie tych funkcji, ich nazwy, w zasadzie wszystko udokumentowane tutaj może zostać zmienione w przyszłych wersjach PHP bez wcześniejszego uprzedzenia. Używaj tego modułu na własne ryzyko. |
Bcompiler was written for two 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 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.
short installation note:
You need at least PHP 4.3. for the compression to work
To install on PHP 4.3 and later at the unix command prompt type pear install bcompiler
To install on Windows, until the binary package distribution mechanism is finished please search the archives of the pear-general mailing list for pre-built packages. (or send an email to it if you could not find a reference)
To install on older versions you need to make some slight changes to the build.
untar the bcompiler.tgz archive into php4/ext.(Get it directly from PECL http://pecl.php.net/get/bcompiler)
If the new directory is now called something like bcompiler-0.x, then you should rename it to bcompiler (except you only want to build it as self-contained php-module).
If you are using versions before PHP 4.3, the you will need to copy the Makefile.in.old to Makefile.in and config.m4.old to config.m4.
run phpize in ext/bcompiler
run ./buildconf in php4
run configure with --enable-bcompiler (and your other options)
make; make install
that's it.
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.
| Poprzedni | Spis treści | Następny |
| bcsub | Początek rozdziału | bcompiler_load_exe |
Język PHP to dzisiaj powszechnie przyjęty standard, podstawa tworzenia dynamicznych stron WWW, opartych na bazach danych.
PHP to język skryptowy. Znaczy to, że jest to język nie kompilowalny. Program jest wykonywany przez interpreter na podstawie jego kodu źródłowego. Język PHP to element technologii internetowej SERVER-SIDE. Znaczy to, że kod języka jest wykonywany od strony serwera (na serwerze).
W jakim celu używac PHP? Po co to komu?
Załóżmy, że potrzebujemy takiej strony internetowej, która wyświetli zawsze bieżącą datę. Dzięki technologii PHP, datę i godzinę odczytywać można z miejsca gdzie wykonuje się skrypt, np. gdy serwer znajduje się w USA a my w Polsce to widoczna jest różnica w czasie który zostanie wyświetlony.
najniższe ceny akcesoria kominkowe DMOZ biżuteria wydarzenia z kraju gofry przeprowadzki tanio Opiniekaszuby domki, usuwanie zmarszczek, wizy do rosji gdańsk, usuwanie zmarszczek, kaszuby domki, marketing, mapa Kamienia Pomorskiego, sfx, nowoczesne projekty domów, Bydgoszcz mapa, Kredyty mieszkaniowe