summaryrefslogtreecommitdiff
path: root/ext/zip/examples
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2006-10-15 21:09:28 +0000
committerSVN Migration <svn@php.net>2006-10-15 21:09:28 +0000
commit88ec761548b66f58acc1a86cdd0fc164ca925476 (patch)
treed0af978fa00d83bb1d82c613f66477fbd6bb18aa /ext/zip/examples
parent268984b4787e797db6054313fc9ba3b9e845306e (diff)
downloadphp-git-PECL_OPENSSL.tar.gz
This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'.PECL_OPENSSL
Diffstat (limited to 'ext/zip/examples')
-rw-r--r--ext/zip/examples/comment.php6
-rw-r--r--ext/zip/examples/create.php20
-rw-r--r--ext/zip/examples/dir.php17
-rw-r--r--ext/zip/examples/extract.php24
-rw-r--r--ext/zip/examples/extractAll.php24
-rw-r--r--ext/zip/examples/fopen.php31
-rw-r--r--ext/zip/examples/get_set_comments.php38
-rw-r--r--ext/zip/examples/im.php11
-rw-r--r--ext/zip/examples/odt.php20
-rw-r--r--ext/zip/examples/oldapi.php17
-rw-r--r--ext/zip/examples/test.odtbin6162 -> 0 bytes
-rw-r--r--ext/zip/examples/test.zipbin541 -> 0 bytes
-rw-r--r--ext/zip/examples/test1.zipbin681 -> 0 bytes
-rw-r--r--ext/zip/examples/test_im.zipbin1086 -> 0 bytes
-rw-r--r--ext/zip/examples/test_with_comment.zipbin560 -> 0 bytes
-rw-r--r--ext/zip/examples/too.php2
16 files changed, 0 insertions, 210 deletions
diff --git a/ext/zip/examples/comment.php b/ext/zip/examples/comment.php
deleted file mode 100644
index 90b37d3795..0000000000
--- a/ext/zip/examples/comment.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-$z = new ZipArchive;
-$z->open('test_with_comment.zip');
-// Add "Foo Comment" as comment for the foo entry
-$z->setCommentName('foo', 'Too Comment ' . time());
-$z->close();
diff --git a/ext/zip/examples/create.php b/ext/zip/examples/create.php
deleted file mode 100644
index cffacee93b..0000000000
--- a/ext/zip/examples/create.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-error_reporting(E_ALL);
-$thisdir = dirname(__FILE__);
-unlink("./test112.zip");
-$zip = new ZipArchive();
-$filename = "./test112.zip";
-
-if (!$zip->open($filename, ZIPARCHIVE::CREATE)) {
- exit("cannot open <$filename>\n");
-} else {
- echo "file <$filename> OK\n";
-}
-
-$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
-$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
-$zip->addFile($thisdir . "/too.php","/testfromfile.php");
-echo "numfiles: " . $zip->numFiles . "\n";
-echo "status:" . $zip->status . "\n";
-$zip->close();
-unset($zip);
diff --git a/ext/zip/examples/dir.php b/ext/zip/examples/dir.php
deleted file mode 100644
index 00e4b40585..0000000000
--- a/ext/zip/examples/dir.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-$za = new ZipArchive();
-
-$za->open('test_with_comment.zip');
-print_r($za);
-var_dump($za);
-echo "numFiles: " . $za->numFiles . "\n";
-echo "status: " . $za->status . "\n";
-echo "statusSys: " . $za->statusSys . "\n";
-echo "filename: " . $za->filename . "\n";
-echo "comment: " . $za->comment . "\n";
-
-for ($i=0; $i<$za->numFiles;$i++) {
- echo "index: $i\n";
- print_r($za->statIndex($i));
-}
-echo "numFile:" . $za->numFiles . "\n";
diff --git a/ext/zip/examples/extract.php b/ext/zip/examples/extract.php
deleted file mode 100644
index 696502ba12..0000000000
--- a/ext/zip/examples/extract.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-$zip = new ZipArchive();
-
-echo $zip->filename . "\n";
-$zip->open("test.zip");
-/*
-$zip->addFile("./modules/");
-$zip->addFile("./testempty");
-*/
-echo $zip->status . "\n";
-echo $zip->statusSys . "\n";
-
-echo $zip->numFiles . "\n";
-echo $zip->filename . "\n";
-var_dump($zip);
-$files = array('test', 'testdir/test2');
-if (!$zip->extractTo("./testext/path/to", $files)) {
- echo "error!\n";
- echo $zip->status . "\n";
- echo $zip->statusSys . "\n";
-
-}
-
-$zip->close();
diff --git a/ext/zip/examples/extractAll.php b/ext/zip/examples/extractAll.php
deleted file mode 100644
index d318a453df..0000000000
--- a/ext/zip/examples/extractAll.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-$zip = new ZipArchive();
-
-echo $zip->filename . "\n";
-$zip->open("test.zip");
-/*
-$zip->addFile("./modules/");
-$zip->addFile("./testempty");
-*/
-echo $zip->status . "\n";
-echo $zip->statusSys . "\n";
-
-echo $zip->numFiles . "\n";
-echo $zip->filename . "\n";
-var_dump($zip);
-$files = array('test', 'testdir/test2');
-if (!$zip->extractTo("./testext/path/to")) {
- echo "error!\n";
- echo $zip->status . "\n";
- echo $zip->statusSys . "\n";
-
-}
-
-$zip->close();
diff --git a/ext/zip/examples/fopen.php b/ext/zip/examples/fopen.php
deleted file mode 100644
index 5af37b1ab3..0000000000
--- a/ext/zip/examples/fopen.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-$fp = fopen('zip://' . dirname(__FILE__) . '/test.zip#test', 'r');
-if (!$fp) {
- exit("cannot open\n");
-}
-while (!feof($fp)) {
- $contents .= fread($fp, 2);
- echo "$contents\n";
-}
-
-fclose($fp);
-echo "done.\n";
-
-
-$content = '';
-$z = new ZipArchive();
-$z->open(dirname(__FILE__) . '/test.zip');
-$fp = $z->getStream('test');
-
-var_dump($fp);
-if(!$fp) exit("\n");
-while (!feof($fp)) {
- $contents .= fread($fp, 2);
-}
-
-fclose($fp);
-file_put_contents('t',$contents);
-echo "done.\n";
-
-
diff --git a/ext/zip/examples/get_set_comments.php b/ext/zip/examples/get_set_comments.php
deleted file mode 100644
index 5bd302e6da..0000000000
--- a/ext/zip/examples/get_set_comments.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-error_reporting(E_ALL|E_STRICT);
-
-copy('test_with_comment.zip', 't.zip');
-$z = new ZipArchive;
-$z->open('t.zip');
-
-print_r($z);
-
-for ($i=0; $i<$z->numFiles; $i++) {
- echo "index: $i\n";
- print_r($z->getCommentIndex($i));
- echo "\n\n";
-}
-echo "foobar/ " . $z->getCommentName('foobar/') . "\n";
-
-echo "Archive comment: " . $z->getArchiveComment() . "\n";
-
-
-$z->setCommentIndex(1, 'new comment idx 1');
-$z->setCommentName('foobar/', 'new comment foobar/');
-
-$z->setArchiveComment( 'new archive comment');
-
-for ($i=0; $i<$z->numFiles; $i++) {
- echo "index: $i\n";
- print_r($z->getCommentIndex($i));
- echo "\n\n";
-}
-
-echo $z->getCommentName('foobar/') . "\n";
-
-// Get the original comment
-echo $z->getCommentName('foobar/', ZIPARCHIVE::FL_UNCHANGED) . "\n";
-
-echo "Archive comment: " . $z->getArchiveComment() . "\n";
-echo "Archive comment (original): " . $z->getArchiveComment(ZIPARCHIVE::FL_UNCHANGED) . "\n";
-
diff --git a/ext/zip/examples/im.php b/ext/zip/examples/im.php
deleted file mode 100644
index 3721434054..0000000000
--- a/ext/zip/examples/im.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-/* $Id$ */
-$im = imagecreatefromgif('zip://' . dirname(__FILE__) . '/test_im.zip#pear_item.gif');
-imagepng($im, 'a.png');
-
-$z = new ZipArchive();
-$z->open(dirname(__FILE__) . '/test_im.zip');
-$im_string = $z->getFromName("pear_item.gif");
-$im = imagecreatefromstring($im_string);
-imagepng($im, 'b.png');
-
diff --git a/ext/zip/examples/odt.php b/ext/zip/examples/odt.php
deleted file mode 100644
index c829f12343..0000000000
--- a/ext/zip/examples/odt.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/* $Id$ */
-$reader = new XMLReader();
-
-$reader->open('zip://' . dirname(__FILE__) . '/test.odt#meta.xml');
-$odt_meta = array();
-while ($reader->read()) {
- if ($reader->nodeType == XMLREADER::ELEMENT) {
- $elm = $reader->name;
- } else {
- if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == 'office:meta') {
- break;
- }
- if (!trim($reader->value)) {
- continue;
- }
- $odt_meta[$elm] = $reader->value;
- }
-}
-print_r($odt_meta);
diff --git a/ext/zip/examples/oldapi.php b/ext/zip/examples/oldapi.php
deleted file mode 100644
index 2f17f43ebd..0000000000
--- a/ext/zip/examples/oldapi.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-$zip = zip_open('examples/test1.zip');
-var_dump($zip);
-
-if ($zip) {
- $i = 0;
- while ($zip_entry = zip_read($zip)) {
- var_dump($zip_entry);
- $txt = zip_entry_read($zip_entry, 10);
- echo $i . ": " . $txt . "size: " . zip_entry_filesize($zip_entry) .
- "comp_method: " . zip_entry_compressionmethod($zip_entry) .
- "\n";
- $i++;
- }
- var_dump($zip_entry);
-}
diff --git a/ext/zip/examples/test.odt b/ext/zip/examples/test.odt
deleted file mode 100644
index 6a816ad749..0000000000
--- a/ext/zip/examples/test.odt
+++ /dev/null
Binary files differ
diff --git a/ext/zip/examples/test.zip b/ext/zip/examples/test.zip
deleted file mode 100644
index 6b98694803..0000000000
--- a/ext/zip/examples/test.zip
+++ /dev/null
Binary files differ
diff --git a/ext/zip/examples/test1.zip b/ext/zip/examples/test1.zip
deleted file mode 100644
index a4deb13c6b..0000000000
--- a/ext/zip/examples/test1.zip
+++ /dev/null
Binary files differ
diff --git a/ext/zip/examples/test_im.zip b/ext/zip/examples/test_im.zip
deleted file mode 100644
index 6385ee9252..0000000000
--- a/ext/zip/examples/test_im.zip
+++ /dev/null
Binary files differ
diff --git a/ext/zip/examples/test_with_comment.zip b/ext/zip/examples/test_with_comment.zip
deleted file mode 100644
index cc65375fb5..0000000000
--- a/ext/zip/examples/test_with_comment.zip
+++ /dev/null
Binary files differ
diff --git a/ext/zip/examples/too.php b/ext/zip/examples/too.php
deleted file mode 100644
index 6d2100811e..0000000000
--- a/ext/zip/examples/too.php
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-echo "too";