sterling Wed Mar 14 23:10:03 2001 EDT
Modified files:
/phpdoc/en/functions bzip2.xml
Log:
Added some <?php ?> tags and expand some of the code examples.
Index: phpdoc/en/functions/bzip2.xml
diff -u phpdoc/en/functions/bzip2.xml:1.3 phpdoc/en/functions/bzip2.xml:1.4
--- phpdoc/en/functions/bzip2.xml:1.3 Mon Feb 19 06:33:56 2001
+++ phpdoc/en/functions/bzip2.xml Wed Mar 14 23:10:03 2001
@@ -127,9 +127,11 @@
<para>
<example>
<title><function>bzcompress</function> Example</title>
- <programlisting role="php">
+ <programlisting role="php"><?php
$str = "sample data";
$bzstr = bzcompress($str, 9);
+print( $bzstr );
+?>
</programlisting>
</example>
</para>
@@ -169,8 +171,19 @@
<para>
<example>
<title><function>bzdecompress</function></title>
- <programlisting role="php">
-$str = $bzdecompress($bzstr);
+ <programlisting role="php"><?php
+$start_str = "This is not an honest face?";
+$bzstr = bzcompress($start_str);
+
+print( "Compressed String: " );
+print( $bzstr );
+print( "\n<br>\n" );
+
+$str = bzdecompress($bzstr);
+print( "Decompressed String: " );
+print( $str );
+print( "\n<br>\n" );
+?>
</programlisting>
</example>
</para>
@@ -226,11 +239,12 @@
<para>
<example>
<title><function>bzerror</function> Example</title>
- <programlisting role="php">
+ <programlisting role="php"><?php
$error = bzerror($bz);
echo $error["errno"];
echo $error["errstr"];
+?>
</programlisting>
</example>
</para>
@@ -319,8 +333,15 @@
<para>
<example>
<title><function>bzopen</function> Example</title>
- <programlisting role="php">
+ <programlisting role="php"><?php
$bz = bzopen("/tmp/foo.bz2", "r");
+$decompressed_file = bzread($bz, filesize("/tmp/foo.bz2"));
+bzclose($bz);
+
+print( "The contents of /tmp/foo.bz2 are: " );
+print( "\n<br>\n" );
+print( $decompressed_file );
+?>
</programlisting>
</example>
</para>
@@ -360,10 +381,11 @@
<para>
<example>
<title><function>bzread</function> Example</title>
- <programlisting role="php">
+ <programlisting role="php"><?php
$bz = bzopen("/tmp/foo.bz2", "r");
$str = bzread($bz, 2048);
-echo $str;
+print( $str );
+?>
</programlisting>
</example>
</para>
@@ -402,10 +424,12 @@
<para>
<example>
<title><function>bzwrite</function> Example</title>
- <programlisting role="php">
+ <programlisting role="php"><?php
$str = "uncompressed data";
$bz = bzopen("/tmp/foo.bz2", "w");
bzwrite($bz, $str, strlen($str));
+bzclose($bz);
+?>
</programlisting>
</example>
</para>