Query: bcompiler_write_exe_footer
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
BCOMPILER_WRITE_EXE_FOOTER(3) 1 BCOMPILER_WRITE_EXE_FOOTER(3) bcompiler_write_exe_footer - Writes the start pos, and sig to the end of a exe type fileSYNOPSISbool bcompiler_write_exe_footer (resource $filehandle, int $startpos)DESCRIPTIONAn EXE (or self executable) file consists of 3 parts: o The stub (executable code, e.g. a compiled C program) that loads PHP interpreter, bcompiler extension, stored Bytecodes and initiates a call for the specified function (e.g. main) or class method (e.g. main::main) oThe Bytecodes (uncompressed only for the moment) oThe bcompiler EXE footer To obtain a suitable stub you can compile php_embed-based stub phpe.c located in the examples/embed directory on bcompiler's CVS.PARAMETERSo $filehandle - A file handle as returned by fopen(3). o $startpos - The file position at which the Bytecodes start, and can be obtained using ftell(3).RETURN VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #1 bcompiler_write_exe_footer(3) example <?php /* creating the output file (example.exe) */ $fh = fopen("example.exe", "w"); /* 1) writing a stub (phpe.exe) */ $size = filesize("phpe.exe"); $fr = fopen("phpe.exe", "r"); fwrite($fh, fread($fr, $size), $size); $startpos = ftell($fh); /* 2) writing bytecodes */ bcompiler_write_header($fh); bcompiler_write_class($fh, "myclass"); bcompiler_write_function($fh, "main"); bcompiler_write_footer($fh); /* 3) writing EXE footer */ bcompiler_write_exe_footer($fh, $startpos); /* closing the output file */ fclose($fh); ?>NOTESWarning This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.SEE ALSObcompiler_write_header(3), bcompiler_write_class(3), bcompiler_write_footer(3). PHP Documentation Group BCOMPILER_WRITE_EXE_FOOTER(3)
Related Man Pages |
---|
stream_set_timeout(3) - php |
fgets(3) - php |
stream_wrapper_register(3) - php |
runkit_method_redefine(3) - php |
stream_filter_register(3) - php |
Similar Topics in the Unix Linux Community |
---|
cut vs. sed vs. awk ? |
.exe files |
need c compilerss |
How . exe files work |
How to build .exe from c |