(PECL bcompiler >= 0.4)
bcompiler_write_exe_footer — 写锟诫开始位锟斤拷锟皆硷拷 exe 锟斤拷锟斤拷锟侥硷拷锟侥斤拷尾锟脚猴拷
$filehandle
, int $startpos
) : bool一锟斤拷 EXE锟斤拷锟斤拷锟斤拷锟街达拷校锟斤拷募锟斤拷锟� 3 锟斤拷锟斤拷锟斤拷桑锟�
为锟剿得碉拷锟绞合碉拷 stub 锟斤拷锟斤拷员锟斤拷锟轿伙拷锟� bcompiler CVS examples/embed 目录锟斤拷 锟斤拷锟斤拷 php_embed 锟斤拷 stub phpe.c锟斤拷
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Example #1 bcompiler_write_exe_footer() 锟斤拷锟斤拷
<?php
/* 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷募锟斤拷锟絜xample.exe锟斤拷 */
$fh = fopen("example.exe", "w");
/* 1) 写锟斤拷一锟斤拷 stub 锟斤拷phpe.exe锟斤拷 */
$size = filesize("phpe.exe");
$fr = fopen("phpe.exe", "r");
fwrite($fh, fread($fr, $size), $size);
$startpos = ftell($fh);
/* 2) 写锟斤拷锟街斤拷锟斤拷 */
bcompiler_write_header($fh);
bcompiler_write_class($fh, "myclass");
bcompiler_write_function($fh, "main");
bcompiler_write_footer($fh);
/* 3) 写锟斤拷 EXE 尾锟斤拷 */
bcompiler_write_exe_footer($fh, $startpos);
/* 锟截憋拷锟斤拷锟斤拷锟斤拷募锟� */
fclose($fh);
?>
锟剿猴拷锟斤拷锟斤拷实锟斤拷锟斤拷锟侥★拷锟剿猴拷锟斤拷锟侥憋拷锟襟,帮拷锟斤拷锟斤拷锟狡硷拷锟斤拷锟斤拷锟斤拷牡锟斤拷锟斤拷锟斤拷锟斤拷锟轿达拷锟斤拷锟� PHP 锟斤拷锟斤拷锟芥本锟斤拷未通知锟酵憋拷锟睫改★拷使锟矫憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟皆碉拷 锟斤拷