suche nach in der

bcompiler_load_exe> <Vordefinierte Konstanten
Last updated: Sat, 07 Jan 2012

view this page in

bcompiler Funktionen

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.

Inhaltsverzeichnis



add a note add a note User Contributed Notes
bcompiler Funktionen
Sinured
01-Jul-2007 05:57
Regarding alan at akbkhome dot com's note:
Not only __FILE__ will be handled differently; same for errors thrown by PHP:

If the file was compiled from a another file (bcompiler_write_file()), then PHP will blame the original filename - looks very strange when you put a file which was compiled under Windows on an UNIX system.

If the file was compiled by bcompiler_write_[class|constant|function](), error messages will contain the filename of the file which has called these functions.
roberto at spadim dot net dot br
25-Jun-2007 07:33
hello guys, since bencoder don't work for __FILE__ constants i have a bcompiler script working, anyone that want it can send me an email
the source is 100% compatible with original file, the only problem is php5 new function methods that
<?
if (!function_exists('function_name')){
 function
function_name()
}
?>
don't work but it's a php5 new method for understand bytecode
cdsheen+bencoder at gmail dot com
25-Jul-2006 02:58
Here's a script to act as a front-end for bcompiler, which may be very similar to the eA ones:

http://bbs.giga.net.tw/bencoder.php

BENCODER v1.1 - Encode your PHP script using bcompiler

Usage: bencoder [-f] -o FILE    file1.php
       bencoder [-f] -o OUTDIR  file1.php file2.php ...
       bencoder [-f] -o OUTDIR  -a SRCDIR  [-s SUFFIX] [-c] [-r]

  -f        : force overwriting even if the target exists
  -o FILE   : the file name to write the encoded script
              (default to '-encoded.php' suffix)
  -o OUTDIR : the directory to write all encoded files

  -a SRCDIR : encode all files in this source directory
  -s SUFFIX : encode the files with the SUFFIX extension only (default: php)
  -c        : copy files those shouldn't be encoded (no by default)
shannah at sfu dot ca
24-May-2006 12:44
>the special constant __FILE__ cannot be handled correctly by bcompiler
> (it will always contain the name of the original file that was compiled).

I would think that this is the preferred behavior anyways since the compilation should be independent from the source code.  I would want to be able to compile any part of my source code without having to worry if any constants will change as a result of it.  Hence it is better for __FILE__ to contain the name of the original file that was compiled.
arplynn at gmail dot com
28-Apr-2006 05:49
PHP seems to choke on trying to compile PHP5 classes with the private, protected or public modifiers. Additionally, when including files with properly compiled classes on PHP5, it works fine but when php tries to exit it throws a segmentation fault.

It's just not a great idea to use bcompiler for anything other than functions on PHP5, at least for now.
tda at example dot com
07-Feb-2006 02:50
Creating a function after checking if a function exists using function_exists will result in a "Zero Sized Reply" error.

this does NOT work any longer:
if (!function_exists("file_get_contents")) {
        function file_get_contents($filename, $use_include_path = 0)
        { ...define your own function here... }
}

Apache returns: "Zero Sized Reply" after compilation.
alan at akbkhome dot com
28-Oct-2005 04:32
Note:
the special constant __FILE__ cannot be handled correctly by bcompiler (it will always contain the name of the original file that was compiled). There is no known way around this, as it is converted to a string by the Zend engine.

bcompiler_load_exe> <Vordefinierte Konstanten
Last updated: Sat, 07 Jan 2012