cvs: pecl /zip/examples fopen.php
| From: | Pierre-Alain Joye | Date: | Sat, 11 Mar 2006 15:46:58 +0000 |
| Subject: | cvs: pecl /zip/examples fopen.php | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-5416@lists.php.net to get a copy of this message | ||
pajoye Sat Mar 11 15:46:58 2006 UTC
Modified files:
/pecl/zip/examples fopen.php
Log:
- fix example
http://cvs.php.net/viewcvs.cgi/pecl/zip/examples/fopen.php?r1=1.1&r2=1.2&diff_format=u
Index: pecl/zip/examples/fopen.php
diff -u pecl/zip/examples/fopen.php:1.1 pecl/zip/examples/fopen.php:1.2
--- pecl/zip/examples/fopen.php:1.1 Mon Jan 16 15:55:58 2006
+++ pecl/zip/examples/fopen.php Sat Mar 11 15:46:58 2006
@@ -1,5 +1,9 @@
<?php
-dl('zip.so');
+if (!extension_loaded('zip')) {
+ dl('zip.so');
+}
+
+
if (0) {
$fp = fopen('zip://test1.zip/test.txt', 'r');
while (!feof($fp)) {
@@ -12,17 +16,17 @@
}
$content = '';
$z = new Zip();
-$z->open('test1.zip');
-$fp = $z->getStream('test.txt', "r");
+$z->open(dirname(__FILE__) . '/test.zip');
+$fp = $z->getStream('test');
var_dump($fp);
if(!$fp) exit("\n");
while (!feof($fp)) {
$contents .= fread($fp, 2);
- echo "$contents\n";
}
fclose($fp);
+file_put_contents('t',$contents);
echo "done.\n";