php-doc-en/reference/bcompiler/functions/bcompiler-write-exe-footer.xml
Friedhelm Betz 39a35fd25a bcompiler docs: move from peardoc
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@166290 c90b9560-bf6c-de11-be94-00142212c4b1
2004-08-13 14:26:44 +00:00

84 lines
2.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- splitted from ./en/functions/bcompiler.xml, last change in rev 1.5 -->
<refentry id="function.bcompiler-write-exe-footer">
<refnamediv>
<refname>bcompiler_write_exe_footer</refname>
<refpurpose>Writes the the start pos, and sig to the end of a exe type file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>bcompiler_write_exe_footer</methodname>
<methodparam><type>resource</type><parameter>filehandle</parameter></methodparam>
<methodparam><type>int</type><parameter>startpos</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
<para>
An EXE (or self executable) file consists of 3 parts,
</para>
<para>
<simplelist>
<member>
The Executable code (eg. a compiled C program that can initiate call
the PHP bcompiler)
</member>
<member>The Bzip encoded Bytecodes</member>
<member>The bcompiler exe footer</member>
</simplelist>
The <parameter>startpos</parameter> is the position of in the file at
which the Bzip encoded bytecodes start, and can be obtained using
ftell($fh).
</para>
<example>
<title><function>bcompiler_write_footer</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$fh = fopen("/tmp/example.exe","w");
$size = filesize("/tmp/base.exe");
$fr = fopen("/tmp/base.exe","r");
fwrite($fh,fread($fr,$size),$size);
$startpos = ftell($fh);
/* write bytecodes compressed */
$fz = bzopen($fh,"w");
bcompiler_write_header($fz);
bcompiler_write_class($fz,"DB");
bcompiler_write_class($fz,"DB_common");
bcompiler_write_footer($fz);
/* write footer exe uncompressed */
bcompiler_write_exe_footer($fh,$startpos);
fclose($fh);
?>
]]>
</programlisting>
</example>
<para>
See also <function>bcompiler_write_header</function>,
<function>bcompiler_write_class</function>, and
<function>bcompiler_write_footer</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->