bcompiler: minor patches
| From: | val khokhlov | Date: | Fri, 17 Sep 2004 09:48:27 +0000 |
| Subject: | bcompiler: minor patches | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-1343@lists.php.net to get a copy of this message | ||
Hello!
i propose some minor patches for bcompiler and one major change (i'll write about it later).
minor patches are:
1) bz2_aware_stream_open() rewritten, so it can auto-detect not only bz2, but also gzip compressed
streams and transparently handle them
2) bcompiler_compile_file() changled a little bit - first of all, there's an obvious bug:
stream is set to NULL (when declaring), if file is included with unknown type, stream is not
changed, so error is generated. for example, include_once [php 4.3.3] uses type 1, which isn't
handled, so *any* include_once causes error. error should be generated only when stream is NULL upon
return from bz2_aware_stream_open(); otherwise, fallback should be done to original
zend_compile_file()
3) second, include_once() in php 4.3.3 uses type 1, which was not handled (while include uses type
0, which _was_ handled) - i've combined processing for types 0, 1 and 2 into single code
fragment. it works ok.
4) third, i've allowed use_bz in bcompiler_compile_file() - it gives possibility to include()
and require() bytecodes just as the plain php source (by the way, it much more convenient than
fopen/bcompiler_load/fclose)
5) at last, php 4.3.3 on win32 crashes in bcompiler_load(). crash is caused by php_stream_close()
call. i added #ifndef PHP_WIN32 around it (yes, i know - it's not correct, but it works w/o
crash)
i've written a message to Alan Knowles, but he didn't answer. i can post a patch (diff -u)
here in order to review it
/vk