vrana Wed Sep 21 17:25:25 2005 EDT
Modified files:
/phpdoc/en/reference/misc/functions halt-compiler.xml
Log:
Document __COMPILER_HALT_OFFSET__
Fix example (PHP_EOL doesn't respect the file format)
http://cvs.php.net/diff.php/phpdoc/en/reference/misc/functions/halt-compiler.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/misc/functions/halt-compiler.xml
diff -u phpdoc/en/reference/misc/functions/halt-compiler.xml:1.2
phpdoc/en/reference/misc/functions/halt-compiler.xml:1.3
--- phpdoc/en/reference/misc/functions/halt-compiler.xml:1.2 Tue Jun 14
21:16:15 2005
+++ phpdoc/en/reference/misc/functions/halt-compiler.xml Wed Sep 21
17:25:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.halt-compiler">
<refnamediv>
<refname>__halt_compiler</refname>
@@ -16,6 +16,10 @@
<para>
This function halts the execution of the compiler. This can be useful to
embed data in PHP scripts, like the installation files.
+ Byte position of the data start can be determined by the
+ <constant>__COMPILER_HALT_OFFSET__</constant> constant which is defined
+ only if there is a <function>__halt_compiler</function> presented in the
+ file.
</para>
<note>
<para>
@@ -38,15 +42,13 @@
$fp = fopen(__FILE__, 'r');
// seek file pointer to data
-// plus the line-feed (that will depend on the file format/OS)
-fseek($fp, __COMPILER_HALT_OFFSET__ + strlen(PHP_EOL));
+fseek($fp, __COMPILER_HALT_OFFSET__);
// and output it
var_dump(stream_get_contents($fp));
// the end of the script execution
-__halt_compiler();
-the instalation data (eg. tar, gz, etc..)
+__halt_compiler();the instalation data (eg. tar, gz, PHP, etc..)
]]>
</programlisting>
</example>