43#define le_zip_dir_name "Zip Directory"
44static int le_zip_entry;
45#define le_zip_entry_name "Zip Entry"
49#define PHP_ZIP_STAT_INDEX(za, index, flags, sb) \
50 if (zip_stat_index(za, index, flags, &sb) != 0) { \
57#define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) \
58 if (path_len == 0) { \
59 zend_argument_must_not_be_empty_error(1); \
62 if (zip_stat(za, path, flags, &sb) != 0) { \
68#define PHP_ZIP_SET_FILE_COMMENT(za, index, comment, comment_len) \
69 if (comment_len == 0) { \
71 if (zip_file_set_comment(za, index, NULL, 0, 0) < 0) { \
74 } else if (zip_file_set_comment(za, index, comment, comment_len, 0) < 0) { \
80# define add_ascii_assoc_string add_assoc_string
81# define add_ascii_assoc_long add_assoc_long
84static char * php_zip_make_relative_path(
char *path,
size_t path_len)
86 char *path_begin = path;
89 if (path_len < 1 || path ==
NULL) {
100 while (i > 0 && !
IS_SLASH(path[i])) {
108 if (i >= 2 && path[i -1] ==
'.') {
110 path_begin = path + i + 1;
120# define CWD_STATE_ALLOC(l) emalloc(l)
121# define CWD_STATE_FREE(s) efree(s)
124static int php_zip_extract_file(
struct zip * za,
char *dest,
const char *
file,
size_t file_len, zip_int64_t idx)
133 char *file_dirname_fullpath;
138 size_t path_cleaned_len;
143 idx = zip_name_locate(za,
file, 0);
149 new_state.
cwd[0] =
'\0';
156 path_cleaned = php_zip_make_relative_path(new_state.
cwd, new_state.
cwd_length);
161 path_cleaned_len =
strlen(path_cleaned);
163 if (path_cleaned_len >=
MAXPATHLEN || zip_stat_index(za, idx, 0, &sb) != 0) {
169 if (path_cleaned_len > 1 &&
IS_SLASH(path_cleaned[path_cleaned_len - 1])) {
170 len =
spprintf(&file_dirname_fullpath, 0,
"%s/%s", dest, path_cleaned);
173 memcpy(file_dirname, path_cleaned, path_cleaned_len);
176 if (!dir_len || (dir_len == 1 && file_dirname[0] ==
'.')) {
177 len =
spprintf(&file_dirname_fullpath, 0,
"%s", dest);
179 len =
spprintf(&file_dirname_fullpath, 0,
"%s/%s", dest, file_dirname);
185 efree(file_dirname_fullpath);
196 efree(file_dirname_fullpath);
207 efree(file_dirname_fullpath);
214 efree(file_dirname_fullpath);
220 efree(file_dirname_fullpath);
232 efree(file_dirname_fullpath);
238 zf = zip_fopen_index(za, idx, 0);
246 if (stream ==
NULL) {
254 while ((
n=zip_fread(zf, b,
sizeof(b))) > 0) {
261 ut.modtime = ut.actime = sb.mtime;
271 efree(file_dirname_fullpath);
283 char *entry_name,
size_t entry_name_len,
284 zip_uint64_t offset_start, zip_uint64_t offset_len,
289 struct zip_source *zs;
309 fd =
fopen(resolved_path,
"rb");
314 zs = zip_source_filep(obj->
za,
fd, offset_start, offset_len);
316 zs = zip_source_file(obj->
za, resolved_path, offset_start, offset_len);
323 if (zip_file_replace(obj->
za, replace, zs,
flags) < 0) {
327 zip_error_clear(obj->
za);
336 zip_error_clear(obj->
za);
350#ifdef HAVE_ENCRYPTION
351 zip_int16_t enc_method;
363 opts->
flags = ZIP_FL_OVERWRITE;
365#ifdef HAVE_ENCRYPTION
366 opts->enc_method = -1;
393#ifdef HAVE_ENCRYPTION
399 opts->enc_method = zval_get_long(option);
403 zend_type_error(
"Option \"enc_password\" must be of type string, %s given",
414 zend_type_error(
"Option \"remove_path\" must be of type string, %s given",
434 zend_type_error(
"Option \"add_path\" must be of type string, %s given",
466#define ZIP_FROM_OBJECT(intern, object) \
468 ze_zip_object *obj = Z_ZIP_P(object); \
471 zend_value_error("Invalid or uninitialized Zip object"); \
478#ifdef HAVE_ENCRYPTION
479#define RETURN_SB(sb) \
481 array_init(return_value); \
482 add_ascii_assoc_string(return_value, "name", (char *)(sb)->name); \
483 add_ascii_assoc_long(return_value, "index", (zend_long) (sb)->index); \
484 add_ascii_assoc_long(return_value, "crc", (zend_long) (sb)->crc); \
485 add_ascii_assoc_long(return_value, "size", (zend_long) (sb)->size); \
486 add_ascii_assoc_long(return_value, "mtime", (zend_long) (sb)->mtime); \
487 add_ascii_assoc_long(return_value, "comp_size", (zend_long) (sb)->comp_size); \
488 add_ascii_assoc_long(return_value, "comp_method", (zend_long) (sb)->comp_method); \
489 add_ascii_assoc_long(return_value, "encryption_method", (zend_long) (sb)->encryption_method); \
492#define RETURN_SB(sb) \
494 array_init(return_value); \
495 add_ascii_assoc_string(return_value, "name", (char *)(sb)->name); \
496 add_ascii_assoc_long(return_value, "index", (zend_long) (sb)->index); \
497 add_ascii_assoc_long(return_value, "crc", (zend_long) (sb)->crc); \
498 add_ascii_assoc_long(return_value, "size", (zend_long) (sb)->size); \
499 add_ascii_assoc_long(return_value, "mtime", (zend_long) (sb)->mtime); \
500 add_ascii_assoc_long(return_value, "comp_size", (zend_long) (sb)->comp_size); \
501 add_ascii_assoc_long(return_value, "comp_method", (zend_long) (sb)->comp_method); \
511#if LIBZIP_VERSION_MAJOR < 1
514 zip_error_get(obj->
za, &zep, &syp);
518 err = zip_get_error(obj->
za);
519 zep = zip_error_code_zip(
err);
538#if LIBZIP_VERSION_MAJOR < 1
541 zip_error_get(obj->
za, &zep, &syp);
545 err = zip_get_error(obj->
za);
546 syp = zip_error_code_system(
err);
557 zip_int64_t num = zip_get_num_entries(obj->
za, 0);
577 return (
char *)zip_get_archive_comment(obj->
za,
len, 0);
585#define GLOB_ONLYDIR (1<<30)
586#define GLOB_EMULATE_ONLYDIR
587#define GLOB_FLAGMASK (~GLOB_ONLYDIR)
589#define GLOB_FLAGMASK (~0)
598# define GLOB_NOSORT 0
601# define GLOB_NOCHECK 0
604# define GLOB_NOESCAPE 0
611#define GLOB_AVAILABLE_FLAGS (0 | GLOB_BRACE | GLOB_MARK | GLOB_NOSORT | GLOB_NOCHECK | GLOB_NOESCAPE | GLOB_ERR | GLOB_ONLYDIR)
653 pattern = work_pattern;
705 if (S_IFDIR != (
s.st_mode & S_IFMT)) {
758 uint32_t i, capture_count;
763 for (i = 0; i < files_cnt; i++) {
774 for (i = 0; i < files_cnt; i++) {
777 size_t namelist_len =
ZSTR_LEN(namelist[i]);
779 if ((namelist_len == 1 &&
ZSTR_VAL(namelist[i])[0] ==
'.') ||
780 (namelist_len == 2 &&
ZSTR_VAL(namelist[i])[0] ==
'.' &&
ZSTR_VAL(namelist[i])[1] ==
'.')) {
785 if ((path_len + namelist_len + 1) >=
MAXPATHLEN) {
787 MAXPATHLEN - 1, (path_len + namelist_len + 1));
814 if (S_IFDIR == (
s.st_mode & S_IFMT)) {
861 const char *retchar =
NULL;
896 obj = php_zip_fetch_object(
object);
904 }
else if (cache_slot) {
905 cache_slot[0] = cache_slot[1] = cache_slot[2] =
NULL;
918 obj = php_zip_fetch_object(
object);
926 return &
EG(error_zval);
938 obj = php_zip_fetch_object(
object);
945 retval = php_zip_property_reader(obj, hnd,
rv);
964 obj = php_zip_fetch_object(
object);
975 }
else if ((prop = php_zip_property_reader(obj, hnd, &tmp)) !=
NULL) {
978 }
else if (
type == 0) {
1007 obj = php_zip_fetch_object(
object);
1016 ret = php_zip_property_reader(obj, hnd, &
val);
1018 ret = &
EG(uninitialized_zval);
1027#ifdef HAVE_PROGRESS_CALLBACK
1028static void _php_zip_progress_callback_free(
void *
ptr)
1032 if (!
Z_ISUNDEF(obj->progress_callback)) {
1039#ifdef HAVE_CANCEL_CALLBACK
1040static void _php_zip_cancel_callback_free(
void *
ptr)
1051static void php_zip_object_free_storage(
zend_object *
object)
1062 zip_discard(intern->
za);
1073#ifdef HAVE_PROGRESS_CALLBACK
1075 _php_zip_progress_callback_free(intern);
1078#ifdef HAVE_CANCEL_CALLBACK
1080 _php_zip_cancel_callback_free(intern);
1096 intern = zend_object_alloc(
sizeof(
ze_zip_object), class_type);
1135 zip_fclose(zr_rsrc->zf);
1175#ifdef COMPILE_DL_ZIP
1209 if (rsrc_int->
za ==
NULL) {
1215 rsrc_int->
num_files = zip_get_num_entries(rsrc_int->
za, 0);
1256 if (rsrc_int && rsrc_int->
za) {
1309 if (zr_rsrc->
zf !=
NULL) {
1358 buffer = zend_string_safe_alloc(1,
len, 0, 0);
1365 zend_string_efree(
buffer);
1387 if (!zr_rsrc->
zf || !zend_hash_index_exists(&
EG(regular_list), zr_rsrc->
zip_rsrc_handle)) {
1399 switch (zr_rsrc->
sb.comp_method) {
1463 char *resolved_path;
1493 efree(resolved_path);
1505 if ((
flags & (ZIP_TRUNCATE | ZIP_RDONLY)) == 0) {
1507 if ((
flags & ZIP_TRUNCATE) == 0) {
1512 if (
VCWD_STAT(resolved_path, &st) == 0 && st.st_size == 0) {
1517 flags |= ZIP_TRUNCATE;
1522 if (!intern ||
err) {
1523 efree(resolved_path);
1528 ze_obj->
za = intern;
1539 size_t password_len;
1547 if (password_len < 1) {
1551 int res = zip_set_default_password(intern, (
const char *)password);
1580 #if LIBZIP_VERSION_MAJOR < 1
1584 zip_error_t *ziperr;
1586 ziperr = zip_get_error(intern);
1587 ze_obj->
err_zip = zip_error_code_zip(ziperr);
1588 ze_obj->
err_sys = zip_error_code_system(ziperr);
1589 zip_error_fini(ziperr);
1592 zip_discard(intern);
1627 num = zip_get_num_entries(intern, 0);
1644 zip_error_clear(ze_obj->
za);
1656#if LIBZIP_VERSION_MAJOR < 1
1658 char error_string[128];
1668#if LIBZIP_VERSION_MAJOR < 1
1670 zip_error_get(ze_obj->
za, &zep, &syp);
1671 len = zip_error_to_str(error_string, 128, zep, syp);
1680 err = zip_get_error(ze_obj->
za);
1682 zip_error_fini(
err);
1686 zip_error_init(&
err);
1689 zip_error_fini(&
err);
1712 if (dirname_len<1) {
1716 if (
dirname[dirname_len-1] !=
'/') {
1719 s[dirname_len] =
'/';
1720 s[dirname_len+1] =
'\0';
1725 if ((
Z_ZIP_P(self)->last_id = zip_dir_add(intern, (
const char *)
s,
flags)) == -1) {
1728 zip_error_clear(intern);
1742 size_t path_len = 1;
1766 if (
options && zend_hash_num_elements(
options) > 0 && (php_zip_parse_options(
options, &opts) < 0)) {
1783 for (i = 0; i < found; i++) {
1784 char *file_stripped, *entry_name;
1785 size_t entry_name_len, file_stripped_len;
1822 entry_name = entry_name_buf;
1823 entry_name_len =
strlen(entry_name);
1830 entry_name, entry_name_len, 0, 0, -1, opts.
flags) < 0) {
1840#ifdef HAVE_ENCRYPTION
1841 if (opts.enc_method >= 0) {
1842 if (zip_file_set_encryption(ze_obj->
za, ze_obj->
last_id, opts.enc_method, opts.enc_password)) {
1850 }
else if (found == 0) {
1876 char *entry_name =
NULL;
1877 size_t entry_name_len = 0;
1878 zend_long offset_start = 0, offset_len = 0;
1883 &filename, &entry_name, &entry_name_len, &offset_start, &offset_len, &
flags) ==
FAILURE) {
1892 if (entry_name_len == 0) {
1894 entry_name_len =
ZSTR_LEN(filename);
1898 entry_name, entry_name_len, offset_start, offset_len, -1,
flags) < 0) {
1911 zend_long offset_start = 0, offset_len = 0;
1916 &filename, &index, &offset_start, &offset_len, &
flags) ==
FAILURE) {
1931 NULL, 0, offset_start, offset_len, index,
flags) < 0) {
1948 struct zip_source *zs;
1979 zip_source_free(zs);
1982 zip_error_clear(intern);
2025 if (zip_stat_index(intern, index,
flags, &sb) != 0) {
2076 name = zip_get_name(intern, (
int) index,
flags);
2100 if (comment_len > 0xffff) {
2105 if (zip_set_archive_comment(intern, (
const char *)comment, comment_len)) {
2119 const char * comment;
2120 int comment_len = 0;
2128 comment = zip_get_archive_comment(intern, &comment_len, (
int)
flags);
2148 if (zip_set_archive_flag(intern, flag, (
int)
value)) {
2175 size_t comment_len, name_len;
2176 char * comment, *
name;
2180 &
name, &name_len, &comment, &comment_len) ==
FAILURE) {
2184 if (name_len == 0) {
2191 if (comment_len > 0xffff) {
2196 idx = zip_name_locate(intern,
name, 0);
2215 &index, &comment, &comment_len) ==
FAILURE) {
2221 if (comment_len > 0xffff) {
2232#ifdef ZIP_OPSYS_DEFAULT
2251 if (name_len == 0) {
2256 idx = zip_name_locate(intern,
name, 0);
2261 if (zip_file_set_external_attributes(intern, idx, (zip_flags_t)
flags,
2262 (zip_uint8_t)(opsys&0xff), (zip_uint32_t)
attr) < 0) {
2285 if (zip_file_set_external_attributes(intern, (zip_uint64_t)index,
2286 (zip_flags_t)
flags, (zip_uint8_t)(opsys&0xff), (zip_uint32_t)
attr) < 0) {
2312 if (name_len == 0) {
2317 idx = zip_name_locate(intern,
name, 0);
2322 if (zip_file_get_external_attributes(intern, idx,
2323 (zip_flags_t)
flags, &opsys, &
attr) < 0) {
2350 if (zip_file_get_external_attributes(intern, (zip_uint64_t)index,
2351 (zip_flags_t)
flags, &opsys, &
attr) < 0) {
2361#ifdef HAVE_ENCRYPTION
2370 size_t name_len, password_len;
2373 &
name, &name_len, &method, &password, &password_len) ==
FAILURE) {
2379 if (name_len == 0) {
2384 idx = zip_name_locate(intern,
name, 0);
2390 if (zip_file_set_encryption(intern, idx, (zip_uint16_t)method, password)) {
2403 char *password =
NULL;
2404 size_t password_len;
2407 &index, &method, &password, &password_len) ==
FAILURE) {
2413 if (zip_file_set_encryption(intern, index, (zip_uint16_t)method, password)) {
2429 zip_uint32_t comment_len = 0;
2430 const char * comment;
2440 if (name_len == 0) {
2445 idx = zip_name_locate(intern,
name, 0);
2451 comment = zip_file_get_comment(intern, idx, &comment_len, (zip_flags_t)
flags);
2462 const char * comment;
2463 zip_uint32_t comment_len = 0;
2474 comment = zip_file_get_comment(intern, index, &comment_len, (zip_flags_t)
flags);
2490 &
name, &name_len, &comp_method, &comp_flags) ==
FAILURE) {
2496 if (name_len == 0) {
2501 idx = zip_name_locate(intern,
name, 0);
2507 if (zip_set_file_compression(intern, (zip_uint64_t)idx,
2508 (zip_int32_t)comp_method, (zip_uint32_t)comp_flags) != 0) {
2524 &index, &comp_method, &comp_flags) ==
FAILURE) {
2530 if (zip_set_file_compression(intern, (zip_uint64_t)index,
2531 (zip_int32_t)comp_method, (zip_uint32_t)comp_flags) != 0) {
2538#ifdef HAVE_SET_MTIME
2556 if (name_len == 0) {
2561 idx = zip_name_locate(intern,
name, 0);
2567 if (zip_file_set_mtime(intern, (zip_uint64_t)idx,
2568 (time_t)mtime, (zip_uint32_t)
flags) != 0) {
2590 if (zip_file_set_mtime(intern, (zip_uint64_t)index,
2591 (time_t)mtime, (zip_uint32_t)
flags) != 0) {
2616 if (zip_delete(intern, index) < 0) {
2644 if (zip_delete(intern, sb.index)) {
2657 size_t new_name_len;
2670 if (new_name_len == 0) {
2675 if (zip_file_rename(intern, index, (
const char *)new_name, 0) != 0) {
2689 char *
name, *new_name;
2690 size_t name_len, new_name_len;
2698 if (new_name_len == 0) {
2705 if (zip_file_rename(intern, sb.index, (
const char *)new_name, 0)) {
2730 if (zip_unchange(intern, index) != 0) {
2759 if (zip_unchange(intern, sb.index) != 0) {
2779 if (zip_unchange_all(intern) != 0) {
2799 if (zip_unchange_archive(intern) != 0) {
2834 if (pathto_len < 1) {
2848 if (!php_zip_extract_file(intern, pathto,
ZSTR_VAL(files_str),
ZSTR_LEN(files_str), -1)) {
2851 }
else if (files_ht) {
2852 nelems = zend_hash_num_elements(files_ht);
2856 for (i = 0; i < nelems; i++) {
2858 if ((zval_file = zend_hash_index_find_deref(files_ht, i)) !=
NULL) {
2872 zip_int64_t i, filecount = zip_get_num_entries(intern, 0);
2874 if (filecount == -1) {
2879 for (i = 0; i < filecount; i++) {
2880 const char *
file = zip_get_name(intern, i, ZIP_FL_UNCHANGED);
2897 struct zip_file *zf;
2934 zf = zip_fopen_index(intern, index,
flags);
2943 buffer = zend_string_safe_alloc(1,
len, 0, 0);
2946 zend_string_efree(
buffer);
3034#ifdef HAVE_PROGRESS_CALLBACK
3035static void _php_zip_progress_callback(zip_t *arch,
double state,
void *
ptr)
3066 if (zip_register_progress_callback_with_state(intern, rate, _php_zip_progress_callback, _php_zip_progress_callback_free, obj)) {
3076#ifdef HAVE_CANCEL_CALLBACK
3077static int _php_zip_cancel_callback(zip_t *arch,
void *
ptr)
3084 retval = zval_get_long(&cb_retval);
3108 if (zip_register_cancel_callback_with_state(intern, _php_zip_cancel_callback, _php_zip_cancel_callback_free, obj)) {
3118#ifdef HAVE_METHOD_SUPPORTED
3128 RETVAL_BOOL(zip_compression_method_supported((zip_int32_t)method, enc));
3141 RETVAL_BOOL(zip_encryption_method_supported((zip_uint16_t)method, enc));
3146static void php_zip_free_prop_handler(
zval *el) {
3155 zip_object_handlers.free_obj = php_zip_object_free_storage;
3156 zip_object_handlers.clone_obj =
NULL;
3157 zip_object_handlers.get_property_ptr_ptr = php_zip_get_property_ptr_ptr;
3159 zip_object_handlers.get_gc = php_zip_get_gc;
3160 zip_object_handlers.get_properties = php_zip_get_properties;
3161 zip_object_handlers.read_property = php_zip_read_property;
3162 zip_object_handlers.has_property = php_zip_has_property;
3163 zip_object_handlers.write_property = php_zip_write_property;
3166 zip_class_entry->create_object = php_zip_object_new;
3167 zip_class_entry->default_object_handlers = &zip_object_handlers;
3170 php_zip_register_prop_handler(&zip_prop_handlers,
"lastId", php_zip_last_id,
NULL,
IS_LONG);
3171 php_zip_register_prop_handler(&zip_prop_handlers,
"status", php_zip_status,
NULL,
IS_LONG);
3172 php_zip_register_prop_handler(&zip_prop_handlers,
"statusSys", php_zip_status_sys,
NULL,
IS_LONG);
3173 php_zip_register_prop_handler(&zip_prop_handlers,
"numFiles", php_zip_get_num_files,
NULL,
IS_LONG);
3174 php_zip_register_prop_handler(&zip_prop_handlers,
"filename",
NULL, php_zipobj_get_filename,
IS_STRING);
3175 php_zip_register_prop_handler(&zip_prop_handlers,
"comment",
NULL, php_zipobj_get_zip_comment,
IS_STRING);
3179 register_php_zip_symbols(module_number);
3204#ifdef HAVE_LIBZIP_VERSION
3205 if (
strcmp(LIBZIP_VERSION, zip_libzip_version())) {
3213#ifdef HAVE_METHOD_SUPPORTED
3215 zip_compression_method_supported(ZIP_CM_BZIP2, 1) ?
"Yes" :
"No");
3217 zip_compression_method_supported(ZIP_CM_XZ, 1) ?
"Yes" :
"No");
3220 zip_compression_method_supported(ZIP_CM_ZSTD, 1) ?
"Yes" :
"No");
3225 zip_encryption_method_supported(ZIP_EM_AES_128, 1) ?
"Yes" :
"No");
3227 zip_encryption_method_supported(ZIP_EM_AES_128, 1) ?
"Yes" :
"No");
3229 zip_encryption_method_supported(ZIP_EM_AES_128, 1) ?
"Yes" :
"No");
file(string $filename, int $flags=0, $context=null)
dirname(string $path, int $levels=1)
fopen(string $filename, string $mode, bool $use_include_path=false, $context=null)
count(Countable|array $value, int $mode=COUNT_NORMAL)
glob(string $pattern, int $flags=0)
basename(string $path, string $suffix="")
const GLOB_AVAILABLE_FLAGS
PHPAPI void php_clear_stat_cache(bool clear_realpath_cache, const char *filename, size_t filename_len)
PHPAPI char * expand_filepath(const char *filepath, char *real_path)
PHPAPI void globfree(glob_t *pglob)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
#define pcre2_match_context
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_MSHUTDOWN_FUNCTION
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
unsigned const char * pos
PHP_JSON_API size_t int options
PHPAPI pcre2_match_context * php_pcre_mctx(void)
PHPAPI pcre2_match_data * php_pcre_create_match_data(uint32_t capture_count, pcre2_code *re)
PHPAPI pcre2_code * pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count)
PHPAPI void php_pcre_free_match_data(pcre2_match_data *match_data)
unsigned char key[REFLECTION_KEY_LEN]
struct _php_stream php_stream
#define php_stream_stat_path_ex(path, flags, ssb, context)
#define php_stream_mkdir(path, mode, options, context)
#define PHP_STREAM_MKDIR_RECURSIVE
#define php_stream_to_zval(stream, zval)
PHPAPI int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b)
#define php_stream_close(stream)
#define php_stream_scandir(dirname, namelist, context, compare)
PHPAPI zend_result php_register_url_stream_wrapper(const char *protocol, const php_stream_wrapper *wrapper)
#define PHP_STREAM_META_TOUCH
#define php_stream_open_wrapper(path, mode, options, opened)
PHPAPI zend_result php_unregister_url_stream_wrapper(const char *protocol)
#define PHP_STREAM_URL_STAT_QUIET
struct _php_stream_statbuf php_stream_statbuf
#define php_stream_write(stream, buf, count)
PHPAPI zend_string * php_basename(const char *s, size_t len, const char *suffix, size_t sufflen)
int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_value)
int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_value)
#define CWD_STATE_FREE(s)
#define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb)
#define ZIP_FROM_OBJECT(intern, object)
#define le_zip_entry_name
#define PHP_ZIP_SET_FILE_COMMENT(za, index, comment, comment_len)
zend_long(* zip_read_int_t)(ze_zip_object *obj)
char *(* zip_read_const_char_t)(ze_zip_object *obj, int *len)
zend_module_entry zip_module_entry
#define PHP_ZIP_STAT_INDEX(za, index, flags, sb)
#define CWD_STATE_ALLOC(l)
struct _zip_prop_handler zip_prop_handler
#define ZIP_OPENBASEDIR_CHECKPATH(filename)
struct _ze_zip_object ze_zip_object
#define ZIP_FL_OPEN_FILE_NOW
php_stream * php_stream_zip_open(struct zip *arch, struct zip_stat *sb, const char *mode, zip_flags_t flags STREAMS_DC)
struct _ze_zip_rsrc zip_rsrc
struct _ze_zip_read_rsrc zip_read_rsrc
const php_stream_wrapper php_stream_zip_wrapper
zip_open(string $filename)
zip_entry_filesize($zip_entry)
zip_entry_compressedsize($zip_entry)
zip_entry_compressionmethod($zip_entry)
zip_entry_open($zip_dp, $zip_entry, string $mode="rb")
zip_entry_name($zip_entry)
zip_entry_close($zip_entry)
zip_entry_read($zip_entry, int $len=1024)
int(* stream_metadata)(php_stream_wrapper *wrapper, const char *url, int options, void *value, php_stream_context *context)
const php_stream_wrapper_ops * wops
php_stream_wrapper * wrapper
zend_long zip_rsrc_handle
zip_uint64_t index_current
zip_read_const_char_t read_const_char_func
zip_read_int_t read_int_func
zend_long remove_all_path
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API ZEND_COLD void zend_type_error(const char *format,...)
ZEND_API ZEND_COLD void zend_value_error(const char *format,...)
#define INTERNAL_FUNCTION_PARAMETERS
#define INTERNAL_FUNCTION_PARAM_PASSTHRU
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type)
ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num)
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
ZEND_API zend_result add_next_index_string(zval *arg, const char *str)
struct _zend_fcall_info_cache zend_fcall_info_cache
#define Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(dest_ht, dest_str)
#define RETURN_STRINGL(s, l)
#define ZEND_PARSE_PARAMETERS_END()
#define ZEND_GET_MODULE(name)
#define zend_parse_parameters_none()
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define ZEND_TRY_ASSIGN_REF_LONG(zv, lval)
#define RETURN_NEW_STR(s)
struct _zend_fcall_info zend_fcall_info
#define call_user_function(function_table, object, function_name, retval_ptr, param_count, params)
#define RETURN_EMPTY_ARRAY()
#define RETURN_EMPTY_STRING()
#define Z_PARAM_PATH(dest, dest_len)
#define ZVAL_STRINGL(z, s, l)
#define RETVAL_STRINGL(s, l)
#define ZVAL_EMPTY_STRING(z)
#define safe_erealloc(ptr, nmemb, size, offset)
#define pefree(ptr, persistent)
#define safe_emalloc(nmemb, size, offset)
strcmp(string $string1, string $string2)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API size_t zend_dirname(char *path, size_t len)
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *str, size_t len)
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_update(HashTable *ht, zend_string *key, zval *pData)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(ht, _key, _ptr)
#define ZEND_HASH_FOREACH_END()
ZEND_API zend_class_entry * zend_ce_countable
ZEND_API void * zend_fetch_resource(zend_resource *res, const char *resource_type_name, int resource_type)
ZEND_API zend_resource * zend_register_resource(void *rsrc_pointer, int rsrc_type)
ZEND_API void ZEND_FASTCALL zend_list_close(zend_resource *res)
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, const char *type_name, int module_number)
struct _zend_string zend_string
struct _zend_module_dep zend_module_dep
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
#define ZEND_MOD_REQUIRED(name)
#define STANDARD_MODULE_HEADER_EX
ZEND_API zval * zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *name, int type, void **cache_slot)
ZEND_API HashTable * zend_std_get_properties(zend_object *zobj)
ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has_set_exists, void **cache_slot)
ZEND_API const zend_object_handlers std_object_handlers
ZEND_API zval * zend_std_write_property(zend_object *zobj, zend_string *name, zval *value, void **cache_slot)
ZEND_API zval * zend_std_read_property(zend_object *zobj, zend_string *name, int type, void **cache_slot, zval *rv)
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op)
#define XtOffsetOf(s_type, field)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
ZEND_API zend_string_init_interned_func_t zend_string_init_interned
#define Z_STRVAL_P(zval_p)
#define Z_ARRVAL_P(zval_p)
struct _zend_resource zend_resource
struct _zend_array HashTable
#define Z_STRLEN_P(zval_p)
#define ZVAL_DOUBLE(z, d)
struct _zend_object_handlers zend_object_handlers
ZEND_API void zval_ptr_dtor(zval *zval_ptr)
CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath)
#define COPY_WHEN_ABSOLUTE(path)
#define IS_ABSOLUTE_PATH(path, len)
#define VCWD_GETCWD(buff, size)
struct _cwd_state cwd_state
#define VCWD_STAT(path, buff)