Lines Matching refs:entry

51 	if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) {  in ZEND_INI_MH()
72 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
81 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
332 phar_entry_info *entry = (phar_entry_info *) Z_PTR_P(zv); in phar_tmpclose_apply() local
334 if (entry->fp_type != PHAR_TMP) { in phar_tmpclose_apply()
338 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
339 php_stream_close(entry->fp); in phar_tmpclose_apply()
340 entry->fp = NULL; in phar_tmpclose_apply()
373 void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */ in destroy_phar_manifest_entry_int() argument
376 if (entry->cfp) { in destroy_phar_manifest_entry_int()
377 php_stream_close(entry->cfp); in destroy_phar_manifest_entry_int()
378 entry->cfp = 0; in destroy_phar_manifest_entry_int()
381 if (entry->fp) { in destroy_phar_manifest_entry_int()
382 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
383 entry->fp = 0; in destroy_phar_manifest_entry_int()
386 if (Z_TYPE(entry->metadata) != IS_UNDEF) { in destroy_phar_manifest_entry_int()
387 if (entry->is_persistent) { in destroy_phar_manifest_entry_int()
388 if (entry->metadata_len) { in destroy_phar_manifest_entry_int()
390 free(Z_PTR(entry->metadata)); in destroy_phar_manifest_entry_int()
392 zval_internal_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry_int()
395 zval_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry_int()
397 entry->metadata_len = 0; in destroy_phar_manifest_entry_int()
398 ZVAL_UNDEF(&entry->metadata); in destroy_phar_manifest_entry_int()
401 if (entry->metadata_str.s) { in destroy_phar_manifest_entry_int()
402 smart_str_free(&entry->metadata_str); in destroy_phar_manifest_entry_int()
403 entry->metadata_str.s = NULL; in destroy_phar_manifest_entry_int()
406 pefree(entry->filename, entry->is_persistent); in destroy_phar_manifest_entry_int()
408 if (entry->link) { in destroy_phar_manifest_entry_int()
409 pefree(entry->link, entry->is_persistent); in destroy_phar_manifest_entry_int()
410 entry->link = 0; in destroy_phar_manifest_entry_int()
413 if (entry->tmp) { in destroy_phar_manifest_entry_int()
414 pefree(entry->tmp, entry->is_persistent); in destroy_phar_manifest_entry_int()
415 entry->tmp = 0; in destroy_phar_manifest_entry_int()
422 phar_entry_info *entry = Z_PTR_P(zv); in destroy_phar_manifest_entry() local
423 destroy_phar_manifest_entry_int(entry); in destroy_phar_manifest_entry()
424 pefree(entry, entry->is_persistent); in destroy_phar_manifest_entry()
671 phar_entry_info entry; in phar_parse_pharfile() local
1058 memset(&entry, 0, sizeof(phar_entry_info)); in phar_parse_pharfile()
1059 entry.phar = mydata; in phar_parse_pharfile()
1060 entry.fp_type = PHAR_FP; in phar_parse_pharfile()
1061 entry.is_persistent = mydata->is_persistent; in phar_parse_pharfile()
1068 PHAR_GET_32(buffer, entry.filename_len); in phar_parse_pharfile()
1070 if (entry.filename_len == 0) { in phar_parse_pharfile()
1074 if (entry.is_persistent) { in phar_parse_pharfile()
1075 entry.manifest_pos = manifest_index; in phar_parse_pharfile()
1078 if (entry.filename_len > (size_t)(endbuffer - buffer - 24)) { in phar_parse_pharfile()
1082 …if ((manifest_ver & PHAR_API_VER_MASK) >= PHAR_API_MIN_DIR && buffer[entry.filename_len - 1] == '/… in phar_parse_pharfile()
1083 entry.is_dir = 1; in phar_parse_pharfile()
1085 entry.is_dir = 0; in phar_parse_pharfile()
1088 phar_add_virtual_dirs(mydata, buffer, entry.filename_len); in phar_parse_pharfile()
1089 entry.filename = pestrndup(buffer, entry.filename_len, entry.is_persistent); in phar_parse_pharfile()
1090 buffer += entry.filename_len; in phar_parse_pharfile()
1091 PHAR_GET_32(buffer, entry.uncompressed_filesize); in phar_parse_pharfile()
1092 PHAR_GET_32(buffer, entry.timestamp); in phar_parse_pharfile()
1095 mydata->min_timestamp = entry.timestamp; in phar_parse_pharfile()
1096 mydata->max_timestamp = entry.timestamp; in phar_parse_pharfile()
1098 if (mydata->min_timestamp > entry.timestamp) { in phar_parse_pharfile()
1099 mydata->min_timestamp = entry.timestamp; in phar_parse_pharfile()
1100 } else if (mydata->max_timestamp < entry.timestamp) { in phar_parse_pharfile()
1101 mydata->max_timestamp = entry.timestamp; in phar_parse_pharfile()
1105 PHAR_GET_32(buffer, entry.compressed_filesize); in phar_parse_pharfile()
1106 PHAR_GET_32(buffer, entry.crc32); in phar_parse_pharfile()
1107 PHAR_GET_32(buffer, entry.flags); in phar_parse_pharfile()
1109 if (entry.is_dir) { in phar_parse_pharfile()
1110 entry.filename_len--; in phar_parse_pharfile()
1111 entry.flags |= PHAR_ENT_PERM_DEF_DIR; in phar_parse_pharfile()
1115 if (entry.is_persistent) { in phar_parse_pharfile()
1116 entry.metadata_len = len; in phar_parse_pharfile()
1118 entry.metadata_len = 0; in phar_parse_pharfile()
1121 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1124 if (phar_parse_metadata(&buffer, &entry.metadata, len) == FAILURE) { in phar_parse_pharfile()
1125 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1130 entry.offset = entry.offset_abs = offset; in phar_parse_pharfile()
1131 offset += entry.compressed_filesize; in phar_parse_pharfile()
1133 switch (entry.flags & PHAR_ENT_COMPRESSION_MASK) { in phar_parse_pharfile()
1136 if (Z_TYPE(entry.metadata) != IS_UNDEF) { in phar_parse_pharfile()
1137 if (entry.is_persistent) { in phar_parse_pharfile()
1138 free(Z_PTR(entry.metadata)); in phar_parse_pharfile()
1140 zval_ptr_dtor(&entry.metadata); in phar_parse_pharfile()
1143 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1149 if (Z_TYPE(entry.metadata) != IS_UNDEF) { in phar_parse_pharfile()
1150 if (entry.is_persistent) { in phar_parse_pharfile()
1151 free(Z_PTR(entry.metadata)); in phar_parse_pharfile()
1153 zval_ptr_dtor(&entry.metadata); in phar_parse_pharfile()
1156 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1161 if (entry.uncompressed_filesize != entry.compressed_filesize) { in phar_parse_pharfile()
1162 if (Z_TYPE(entry.metadata) != IS_UNDEF) { in phar_parse_pharfile()
1163 if (entry.is_persistent) { in phar_parse_pharfile()
1164 free(Z_PTR(entry.metadata)); in phar_parse_pharfile()
1166 zval_ptr_dtor(&entry.metadata); in phar_parse_pharfile()
1169 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1175 manifest_flags |= (entry.flags & PHAR_ENT_COMPRESSION_MASK); in phar_parse_pharfile()
1177 entry.is_crc_checked = (manifest_flags & PHAR_HDR_SIGNATURE ? 1 : 0); in phar_parse_pharfile()
1178 phar_set_inode(&entry); in phar_parse_pharfile()
1180 str = zend_string_init_interned(entry.filename, entry.filename_len, 1); in phar_parse_pharfile()
1182 str = zend_string_init(entry.filename, entry.filename_len, 0); in phar_parse_pharfile()
1184 zend_hash_add_mem(&mydata->manifest, str, (void*)&entry, sizeof(phar_entry_info)); in phar_parse_pharfile()
2200 …har *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len… in phar_split_fname() argument
2253 *entry = estrndup(ext_str+ext_len, *entry_len); in phar_split_fname()
2255 phar_unixify_path_separators(*entry, *entry_len); in phar_split_fname()
2257 *entry = phar_fix_filepath(*entry, entry_len, 0); in phar_split_fname()
2260 *entry = estrndup("/", 1); in phar_split_fname()
2349 phar_entry_info *entry = idata->internal_file; in phar_postprocess_file() local
2355 if (entry->is_zip && process_zip > 0) { in phar_postprocess_file()
2361 … archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename); in phar_postprocess_file()
2364 php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET); in phar_postprocess_file()
2368 …phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2375 entry->header_offset + sizeof(local) + in phar_postprocess_file()
2378 entry->compressed_filesize, SEEK_SET); in phar_postprocess_file()
2381 … \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2392entry->filename_len != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32)… in phar_postprocess_file()
2393 …cal header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename); in phar_postprocess_file()
2398 entry->offset = entry->offset_abs = in phar_postprocess_file()
2399 …sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_l… in phar_postprocess_file()
2401 if (idata->zero && idata->zero != entry->offset_abs) { in phar_postprocess_file()
2402 idata->zero = entry->offset_abs; in phar_postprocess_file()
2419 entry->is_crc_checked = 1; in phar_postprocess_file()
2422 …l corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2442 phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); in phar_flush_clean_deleted_apply() local
2444 if (entry->fp_refcount <= 0 && entry->is_deleted) { in phar_flush_clean_deleted_apply()
2504 phar_entry_info *entry, *newentry; in phar_flush() local
2693 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
2694 if (entry->cfp) { in phar_flush()
2696 php_stream_close(entry->cfp); in phar_flush()
2697 entry->cfp = 0; in phar_flush()
2699 if (entry->is_deleted || entry->is_mounted) { in phar_flush()
2703 if (!entry->is_modified && entry->fp_refcount) { in phar_flush()
2705 switch (entry->fp_type) { in phar_flush()
2717 phar_add_virtual_dirs(phar, entry->filename, entry->filename_len); in phar_flush()
2719 if (entry->is_dir) { in phar_flush()
2723 if (Z_TYPE(entry->metadata) != IS_UNDEF) { in phar_flush()
2724 if (entry->metadata_str.s) { in phar_flush()
2725 smart_str_free(&entry->metadata_str); in phar_flush()
2727 entry->metadata_str.s = NULL; in phar_flush()
2729 php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash); in phar_flush()
2732 if (entry->metadata_str.s) { in phar_flush()
2733 smart_str_free(&entry->metadata_str); in phar_flush()
2735 entry->metadata_str.s = NULL; in phar_flush()
2739 …offset += 4 + entry->filename_len + sizeof(entry_buffer) + (entry->metadata_str.s ? ZSTR_LEN(entry in phar_flush()
2742 if ((oldfile && !entry->is_modified) || entry->is_dir) { in phar_flush()
2743 if (entry->fp_type == PHAR_UFP) { in phar_flush()
2745 entry->fp_type = PHAR_FP; in phar_flush()
2749 if (!phar_get_efp(entry, 0)) { in phar_flush()
2751 newentry = phar_open_jit(phar, entry, error); in phar_flush()
2758 entry = newentry; in phar_flush()
2760 file = phar_get_efp(entry, 0); in phar_flush()
2761 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) { in phar_flush()
2767 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2772 mytime = entry->uncompressed_filesize; in phar_flush()
2776 entry->crc32 = ~newcrc32; in phar_flush()
2777 entry->is_crc_checked = 1; in phar_flush()
2778 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) { in phar_flush()
2780 entry->compressed_filesize = entry->uncompressed_filesize; in phar_flush()
2783 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); in phar_flush()
2789 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_flush()
2791 …spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar… in phar_flush()
2795 …spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, pha… in phar_flush()
2807 entry->cfp = shared_cfp; in phar_flush()
2808 if (!entry->cfp) { in phar_flush()
2819 ZEND_ASSERT(entry->header_offset == 0); in phar_flush()
2820 entry->header_offset = php_stream_tell(entry->cfp); in phar_flush()
2822 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_flush()
2828 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2832 php_stream_filter_append((&entry->cfp->writefilters), filter); in phar_flush()
2833 …if (SUCCESS != php_stream_copy_to_stream_ex(file, entry->cfp, entry->uncompressed_filesize, NULL))… in phar_flush()
2839 … compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2844 php_stream_flush(entry->cfp); in phar_flush()
2846 php_stream_seek(entry->cfp, 0, SEEK_END); in phar_flush()
2847 entry->compressed_filesize = ((uint32_t) php_stream_tell(entry->cfp)) - entry->header_offset; in phar_flush()
2849 entry->old_flags = entry->flags; in phar_flush()
2850 entry->is_modified = 1; in phar_flush()
2851 global_flags |= (entry->flags & PHAR_ENT_COMPRESSION_MASK); in phar_flush()
2933 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
2934 if (entry->is_deleted || entry->is_mounted) { in phar_flush()
2939 if (entry->is_dir) { in phar_flush()
2941 phar_set_32(entry_buffer, entry->filename_len + 1); in phar_flush()
2943 phar_set_32(entry_buffer, entry->filename_len); in phar_flush()
2947 || entry->filename_len != php_stream_write(newfile, entry->filename, entry->filename_len) in phar_flush()
2948 || (entry->is_dir && 1 != php_stream_write(newfile, "/", 1))) { in phar_flush()
2954 if (entry->is_dir) { in phar_flush()
2955 …le to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2957 …"unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2973 phar_set_32(entry_buffer, entry->uncompressed_filesize); in phar_flush()
2975 phar_set_32(entry_buffer+8, entry->compressed_filesize); in phar_flush()
2976 phar_set_32(entry_buffer+12, entry->crc32); in phar_flush()
2977 phar_set_32(entry_buffer+16, entry->flags); in phar_flush()
2978 phar_set_32(entry_buffer+20, entry->metadata_str.s ? ZSTR_LEN(entry->metadata_str.s) : 0); in phar_flush()
2981 || (entry->metadata_str.s && in phar_flush()
2982 …ZSTR_LEN(entry->metadata_str.s) != php_stream_write(newfile, ZSTR_VAL(entry->metadata_str.s), ZSTR… in phar_flush()
2990 … write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3015 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
3016 if (entry->is_deleted || entry->is_dir || entry->is_mounted) { in phar_flush()
3020 if (entry->cfp) { in phar_flush()
3021 file = entry->cfp; in phar_flush()
3022 php_stream_seek(file, entry->header_offset, SEEK_SET); in phar_flush()
3024 file = phar_get_efp(entry, 0); in phar_flush()
3025 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_flush()
3031 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3043 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3049 entry->offset = entry->offset_abs = offset; in phar_flush()
3050 offset += entry->compressed_filesize; in phar_flush()
3051 if (php_stream_copy_to_stream_ex(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) { in phar_flush()
3059 …spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, … in phar_flush()
3065 entry->is_modified = 0; in phar_flush()
3067 if (entry->cfp) { in phar_flush()
3068 entry->cfp = NULL; in phar_flush()
3069 entry->header_offset = 0; in phar_flush()
3072 if (entry->fp_type == PHAR_MOD) { in phar_flush()
3074 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) { in phar_flush()
3075 php_stream_close(entry->fp); in phar_flush()
3078 entry->fp = NULL; in phar_flush()
3079 entry->fp_type = PHAR_FP; in phar_flush()
3080 } else if (entry->fp_type == PHAR_UFP) { in phar_flush()
3081 entry->fp_type = PHAR_FP; in phar_flush()
3225 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
3226 if (entry->cfp) { in phar_flush()
3227 entry->cfp = NULL; in phar_flush()
3228 entry->header_offset = 0; in phar_flush()