summaryrefslogtreecommitdiff
path: root/ext/zip
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-03 13:41:45 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-02-03 13:42:08 +0100
commit169805777c17892865ae462ae0a0895344a7fd3c (patch)
tree715ab54d18d387e0f2fec607a97462af525f2556 /ext/zip
parent6b38251820be4ab2eb38c55d41c6680d0bff83f3 (diff)
parent58b17906f512866c2e34844fa497ecdf7f1e1e3d (diff)
downloadphp-git-169805777c17892865ae462ae0a0895344a7fd3c.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Apply tidy formatting
Diffstat (limited to 'ext/zip')
-rw-r--r--ext/zip/examples/addglob.php4
-rw-r--r--ext/zip/examples/create.php4
-rw-r--r--ext/zip/examples/dir.php4
-rw-r--r--ext/zip/examples/encryption.php6
-rw-r--r--ext/zip/examples/extract.php6
-rw-r--r--ext/zip/examples/extractAll.php6
-rw-r--r--ext/zip/examples/fopen.php8
-rw-r--r--ext/zip/examples/get_set_comments.php12
-rw-r--r--ext/zip/examples/odt.php22
-rw-r--r--ext/zip/examples/oldapi.php18
-rw-r--r--ext/zip/examples/set_compression.php2
11 files changed, 46 insertions, 46 deletions
diff --git a/ext/zip/examples/addglob.php b/ext/zip/examples/addglob.php
index 3c432f0be5..13ea83b02a 100644
--- a/ext/zip/examples/addglob.php
+++ b/ext/zip/examples/addglob.php
@@ -5,8 +5,8 @@ $z->open('a.zip', ZIPARCHIVE::CREATE);
/* or 'remove_all_path' => 0*/
$options = array(
- 'remove_path' => '/home/francis/myimages',
- 'add_path' => 'images/',
+ 'remove_path' => '/home/francis/myimages',
+ 'add_path' => 'images/',
);
$found = $z->addGlob("/home/pierre/cvs/gd/libgd/tests/*.png", 0, $options);
var_dump($found);
diff --git a/ext/zip/examples/create.php b/ext/zip/examples/create.php
index a41c8e6d0b..d835704c8e 100644
--- a/ext/zip/examples/create.php
+++ b/ext/zip/examples/create.php
@@ -9,9 +9,9 @@ $zip = new ZipArchive();
$filename = "./test112.zip";
if (!$zip->open($filename, ZIPARCHIVE::CREATE)) {
- exit("cannot open <$filename>\n");
+ exit("cannot open <$filename>\n");
} else {
- echo "file <$filename> OK\n";
+ echo "file <$filename> OK\n";
}
$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
diff --git a/ext/zip/examples/dir.php b/ext/zip/examples/dir.php
index c362a72ba3..6fe56c0b9b 100644
--- a/ext/zip/examples/dir.php
+++ b/ext/zip/examples/dir.php
@@ -15,7 +15,7 @@ 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 "index: $i\n";
+ print_r($za->statIndex($i));
}
echo "numFile:" . $za->numFiles . "\n";
diff --git a/ext/zip/examples/encryption.php b/ext/zip/examples/encryption.php
index 9ef7dd8497..42d3850404 100644
--- a/ext/zip/examples/encryption.php
+++ b/ext/zip/examples/encryption.php
@@ -40,9 +40,9 @@ $zip->close();
echo "== Stream with context\n";
$ctx = stream_context_create(array(
- 'zip' => array(
- 'password' => $pass
- )
+ 'zip' => array(
+ 'password' => $pass
+ )
));
$text = file_get_contents("zip://$name#$file", false, $ctx);
printf("Size = %d\n", strlen($text));
diff --git a/ext/zip/examples/extract.php b/ext/zip/examples/extract.php
index 5276b0dca5..01a9c75aee 100644
--- a/ext/zip/examples/extract.php
+++ b/ext/zip/examples/extract.php
@@ -19,9 +19,9 @@ 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";
+ echo "error!\n";
+ echo $zip->status . "\n";
+ echo $zip->statusSys . "\n";
}
diff --git a/ext/zip/examples/extractAll.php b/ext/zip/examples/extractAll.php
index d318a453df..69286b93ec 100644
--- a/ext/zip/examples/extractAll.php
+++ b/ext/zip/examples/extractAll.php
@@ -15,9 +15,9 @@ 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";
+ echo "error!\n";
+ echo $zip->status . "\n";
+ echo $zip->statusSys . "\n";
}
diff --git a/ext/zip/examples/fopen.php b/ext/zip/examples/fopen.php
index 80de5d052a..4dcedba74a 100644
--- a/ext/zip/examples/fopen.php
+++ b/ext/zip/examples/fopen.php
@@ -6,11 +6,11 @@ if (!extension_loaded('zip')) {
$fp = fopen('zip://' . dirname(__FILE__) . '/test.zip#test', 'r');
if (!$fp) {
- exit("cannot open\n");
+ exit("cannot open\n");
}
while (!feof($fp)) {
- $contents .= fread($fp, 2);
- echo "$contents\n";
+ $contents .= fread($fp, 2);
+ echo "$contents\n";
}
fclose($fp);
@@ -25,7 +25,7 @@ $fp = $z->getStream('test');
var_dump($fp);
if(!$fp) exit("\n");
while (!feof($fp)) {
- $contents .= fread($fp, 2);
+ $contents .= fread($fp, 2);
}
fclose($fp);
diff --git a/ext/zip/examples/get_set_comments.php b/ext/zip/examples/get_set_comments.php
index 600b51138d..a9faf08f33 100644
--- a/ext/zip/examples/get_set_comments.php
+++ b/ext/zip/examples/get_set_comments.php
@@ -7,9 +7,9 @@ $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 "index: $i\n";
+ print_r($z->getCommentIndex($i));
+ echo "\n\n";
}
echo "foobar/ " . $z->getCommentName('foobar/') . "\n";
@@ -22,9 +22,9 @@ $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 "index: $i\n";
+ print_r($z->getCommentIndex($i));
+ echo "\n\n";
}
echo $z->getCommentName('foobar/') . "\n";
diff --git a/ext/zip/examples/odt.php b/ext/zip/examples/odt.php
index 195c781e33..3f923296a1 100644
--- a/ext/zip/examples/odt.php
+++ b/ext/zip/examples/odt.php
@@ -5,16 +5,16 @@ $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;
- }
+ 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
index 82a6277f3a..216de4837e 100644
--- a/ext/zip/examples/oldapi.php
+++ b/ext/zip/examples/oldapi.php
@@ -4,14 +4,14 @@ $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);
+ $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);
+ "comp_method: " . zip_entry_compressionmethod($zip_entry) .
+ "\n";
+ $i++;
+ }
+ var_dump($zip_entry);
}
diff --git a/ext/zip/examples/set_compression.php b/ext/zip/examples/set_compression.php
index 1efd88c7f1..49494e0bf7 100644
--- a/ext/zip/examples/set_compression.php
+++ b/ext/zip/examples/set_compression.php
@@ -8,7 +8,7 @@ $zip = new ZipArchive();
$filename = "a.zip";
if (!$zip->open($filename, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) {
- exit("cannot open <$filename>\n");
+ exit("cannot open <$filename>\n");
}
$zip->addFromString("testfilephp.txt", "#1 This is a test string added as testfilephp.txt.\n");