Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/zip/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (PHP_ZIP != "no") {
}

AC_DEFINE('HAVE_ZIP', 1, "Define to 1 if the PHP extension 'zip' is available.");
ADD_FLAG("CFLAGS_ZIP", "/D HAVE_SET_MTIME /D HAVE_ENCRYPTION /D HAVE_LIBZIP_VERSION /D HAVE_PROGRESS_CALLBACK /D HAVE_CANCEL_CALLBACK /D HAVE_METHOD_SUPPORTED /D LZMA_API_STATIC");
ADD_FLAG("CFLAGS_ZIP", "/D HAVE_ENCRYPTION /D HAVE_LIBZIP_VERSION /D HAVE_PROGRESS_CALLBACK /D HAVE_CANCEL_CALLBACK /D HAVE_METHOD_SUPPORTED /D LZMA_API_STATIC");
} else {
WARNING("zip not enabled; libraries and headers not found");
}
Expand Down
2 changes: 0 additions & 2 deletions ext/zip/php_zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,6 @@ PHP_METHOD(ZipArchive, setCompressionIndex)
}
/* }}} */

#ifdef HAVE_SET_MTIME
/* {{{ Set the modification time of a file in zip, using its name */
PHP_METHOD(ZipArchive, setMtimeName)
{
Expand Down Expand Up @@ -2477,7 +2476,6 @@ PHP_METHOD(ZipArchive, setMtimeIndex)
(time_t)mtime, (zip_uint32_t)flags) == 0);
}
/* }}} */
#endif

/* {{{ Delete a file using its index */
PHP_METHOD(ZipArchive, deleteIndex)
Expand Down
2 changes: 0 additions & 2 deletions ext/zip/php_zip.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,13 +704,11 @@ public function setCommentIndex(int $index, string $comment): bool {}
/** @tentative-return-type */
public function setCommentName(string $name, string $comment): bool {}

#ifdef HAVE_SET_MTIME
/** @tentative-return-type */
public function setMtimeIndex(int $index, int $timestamp, int $flags = 0): bool {}

/** @tentative-return-type */
public function setMtimeName(string $name, int $timestamp, int $flags = 0): bool {}
#endif

/** @tentative-return-type */
public function getCommentIndex(int $index, int $flags = 0): string|false {}
Expand Down
8 changes: 1 addition & 7 deletions ext/zip/php_zip_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions ext/zip/tests/oo_setmtime.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
setMtime
--EXTENSIONS--
zip
--SKIPIF--
<?php
/* $Id$ */
if (!method_exists('ZipArchive', 'setMtimeName')) die('skip libzip too old');
?>
--INI--
date.timezone=UTC
--FILE--
Expand Down
7 changes: 0 additions & 7 deletions ext/zip/zip_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,11 @@ static ssize_t php_zip_ops_read(php_stream *stream, char *buf, size_t count)
if (self->zf) {
n = zip_fread(self->zf, buf, count);
if (n < 0) {
#if LIBZIP_VERSION_MAJOR < 1
int ze, se;
zip_file_error_get(self->zf, &ze, &se);
stream->eof = 1;
php_error_docref(NULL, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf));
#else
zip_error_t *err;
err = zip_file_get_error(self->zf);
stream->eof = 1;
php_error_docref(NULL, E_WARNING, "Zip stream error: %s", zip_error_strerror(err));
zip_error_fini(err);
#endif
return -1;
}
/* cast count to signed value to avoid possibly negative n
Expand Down