Lines Matching refs:entry
57 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
67 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
76 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
314 phar_entry_info *entry = (phar_entry_info *) Z_PTR_P(zv); in phar_tmpclose_apply() local
316 if (entry->fp_type != PHAR_TMP) { in phar_tmpclose_apply()
320 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
321 php_stream_close(entry->fp); in phar_tmpclose_apply()
322 entry->fp = NULL; in phar_tmpclose_apply()
355 void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */ in destroy_phar_manifest_entry_int() argument
358 if (entry->cfp) { in destroy_phar_manifest_entry_int()
359 php_stream_close(entry->cfp); in destroy_phar_manifest_entry_int()
360 entry->cfp = 0; in destroy_phar_manifest_entry_int()
363 if (entry->fp) { in destroy_phar_manifest_entry_int()
364 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
365 entry->fp = 0; in destroy_phar_manifest_entry_int()
368 phar_metadata_tracker_free(&entry->metadata_tracker, entry->is_persistent); in destroy_phar_manifest_entry_int()
370 pefree(entry->filename, entry->is_persistent); in destroy_phar_manifest_entry_int()
372 if (entry->link) { in destroy_phar_manifest_entry_int()
373 pefree(entry->link, entry->is_persistent); in destroy_phar_manifest_entry_int()
374 entry->link = 0; in destroy_phar_manifest_entry_int()
377 if (entry->tmp) { in destroy_phar_manifest_entry_int()
378 pefree(entry->tmp, entry->is_persistent); in destroy_phar_manifest_entry_int()
379 entry->tmp = 0; in destroy_phar_manifest_entry_int()
386 phar_entry_info *entry = Z_PTR_P(zv); in destroy_phar_manifest_entry() local
387 destroy_phar_manifest_entry_int(entry); in destroy_phar_manifest_entry()
388 pefree(entry, entry->is_persistent); in destroy_phar_manifest_entry()
737 phar_entry_info entry; in phar_parse_pharfile() local
1127 memset(&entry, 0, sizeof(phar_entry_info)); in phar_parse_pharfile()
1128 entry.phar = mydata; in phar_parse_pharfile()
1129 entry.fp_type = PHAR_FP; in phar_parse_pharfile()
1130 entry.is_persistent = mydata->is_persistent; in phar_parse_pharfile()
1137 PHAR_GET_32(buffer, entry.filename_len); in phar_parse_pharfile()
1139 if (entry.filename_len == 0) { in phar_parse_pharfile()
1143 if (entry.is_persistent) { in phar_parse_pharfile()
1144 entry.manifest_pos = manifest_index; in phar_parse_pharfile()
1147 if (entry.filename_len > (size_t)(endbuffer - buffer - 24)) { in phar_parse_pharfile()
1151 …if ((manifest_ver & PHAR_API_VER_MASK) >= PHAR_API_MIN_DIR && buffer[entry.filename_len - 1] == '/… in phar_parse_pharfile()
1152 entry.is_dir = 1; in phar_parse_pharfile()
1154 entry.is_dir = 0; in phar_parse_pharfile()
1157 phar_add_virtual_dirs(mydata, buffer, entry.filename_len); in phar_parse_pharfile()
1158 entry.filename = pestrndup(buffer, entry.filename_len, entry.is_persistent); in phar_parse_pharfile()
1159 buffer += entry.filename_len; in phar_parse_pharfile()
1160 PHAR_GET_32(buffer, entry.uncompressed_filesize); in phar_parse_pharfile()
1161 PHAR_GET_32(buffer, entry.timestamp); in phar_parse_pharfile()
1164 mydata->min_timestamp = entry.timestamp; in phar_parse_pharfile()
1165 mydata->max_timestamp = entry.timestamp; in phar_parse_pharfile()
1167 if (mydata->min_timestamp > entry.timestamp) { in phar_parse_pharfile()
1168 mydata->min_timestamp = entry.timestamp; in phar_parse_pharfile()
1169 } else if (mydata->max_timestamp < entry.timestamp) { in phar_parse_pharfile()
1170 mydata->max_timestamp = entry.timestamp; in phar_parse_pharfile()
1174 PHAR_GET_32(buffer, entry.compressed_filesize); in phar_parse_pharfile()
1175 PHAR_GET_32(buffer, entry.crc32); in phar_parse_pharfile()
1176 PHAR_GET_32(buffer, entry.flags); in phar_parse_pharfile()
1178 if (entry.is_dir) { in phar_parse_pharfile()
1179 entry.filename_len--; in phar_parse_pharfile()
1180 entry.flags |= PHAR_ENT_PERM_DEF_DIR; in phar_parse_pharfile()
1185 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1190 ZVAL_UNDEF(&entry.metadata_tracker.val); in phar_parse_pharfile()
1191 entry.metadata_tracker.str = NULL; in phar_parse_pharfile()
1192 phar_parse_metadata_lazy(buffer, &entry.metadata_tracker, len, entry.is_persistent); in phar_parse_pharfile()
1195 entry.offset = entry.offset_abs = offset; in phar_parse_pharfile()
1196 offset += entry.compressed_filesize; in phar_parse_pharfile()
1198 switch (entry.flags & PHAR_ENT_COMPRESSION_MASK) { in phar_parse_pharfile()
1201 phar_metadata_tracker_free(&entry.metadata_tracker, entry.is_persistent); in phar_parse_pharfile()
1202 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1208 phar_metadata_tracker_free(&entry.metadata_tracker, entry.is_persistent); in phar_parse_pharfile()
1209 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1214 if (entry.uncompressed_filesize != entry.compressed_filesize) { in phar_parse_pharfile()
1215 phar_metadata_tracker_free(&entry.metadata_tracker, entry.is_persistent); in phar_parse_pharfile()
1216 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1222 manifest_flags |= (entry.flags & PHAR_ENT_COMPRESSION_MASK); in phar_parse_pharfile()
1224 entry.is_crc_checked = (manifest_flags & PHAR_HDR_SIGNATURE ? 1 : 0); in phar_parse_pharfile()
1225 phar_set_inode(&entry); in phar_parse_pharfile()
1227 str = zend_string_init_interned(entry.filename, entry.filename_len, 1); in phar_parse_pharfile()
1229 str = zend_string_init(entry.filename, entry.filename_len, 0); in phar_parse_pharfile()
1231 zend_hash_add_mem(&mydata->manifest, str, (void*)&entry, sizeof(phar_entry_info)); in phar_parse_pharfile()
2240 …har *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len… in phar_split_fname() argument
2293 *entry = estrndup(ext_str+ext_len, *entry_len); in phar_split_fname()
2295 phar_unixify_path_separators(*entry, *entry_len); in phar_split_fname()
2297 *entry = phar_fix_filepath(*entry, entry_len, 0); in phar_split_fname()
2300 *entry = estrndup("/", 1); in phar_split_fname()
2381 phar_entry_info *entry = idata->internal_file; in phar_postprocess_file() local
2387 if (entry->is_zip && process_zip > 0) { in phar_postprocess_file()
2393 … archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename); in phar_postprocess_file()
2396 php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET); in phar_postprocess_file()
2400 …phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2407 entry->header_offset + sizeof(local) + in phar_postprocess_file()
2410 entry->compressed_filesize, SEEK_SET); in phar_postprocess_file()
2413 … \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2424 …entry->filename_len != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32)… in phar_postprocess_file()
2425 …cal header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename); in phar_postprocess_file()
2430 entry->offset = entry->offset_abs = in phar_postprocess_file()
2431 …sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_l… in phar_postprocess_file()
2433 if (idata->zero && idata->zero != entry->offset_abs) { in phar_postprocess_file()
2434 idata->zero = entry->offset_abs; in phar_postprocess_file()
2450 entry->is_crc_checked = 1; in phar_postprocess_file()
2453 …l corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2473 phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); in phar_flush_clean_deleted_apply() local
2475 if (entry->fp_refcount <= 0 && entry->is_deleted) { in phar_flush_clean_deleted_apply()
2537 phar_entry_info *entry, *newentry; in phar_flush_ex() local
2691 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) { in phar_flush_ex()
2692 if (entry->cfp) { in phar_flush_ex()
2694 php_stream_close(entry->cfp); in phar_flush_ex()
2695 entry->cfp = 0; in phar_flush_ex()
2697 if (entry->is_deleted || entry->is_mounted) { in phar_flush_ex()
2701 if (!entry->is_modified && entry->fp_refcount) { in phar_flush_ex()
2703 switch (entry->fp_type) { in phar_flush_ex()
2715 phar_add_virtual_dirs(phar, entry->filename, entry->filename_len); in phar_flush_ex()
2717 if (entry->is_dir) { in phar_flush_ex()
2721 if (!Z_ISUNDEF(entry->metadata_tracker.val) && !entry->metadata_tracker.str) { in phar_flush_ex()
2722 ZEND_ASSERT(!entry->is_persistent); in phar_flush_ex()
2726 php_var_serialize(&buf, &entry->metadata_tracker.val, &metadata_hash); in phar_flush_ex()
2728 entry->metadata_tracker.str = buf.s; in phar_flush_ex()
2732 …ffset += 4 + entry->filename_len + sizeof(entry_buffer) + (entry->metadata_tracker.str ? ZSTR_LEN(… in phar_flush_ex()
2735 if ((oldfile && !entry->is_modified) || entry->is_dir) { in phar_flush_ex()
2736 if (entry->fp_type == PHAR_UFP) { in phar_flush_ex()
2738 entry->fp_type = PHAR_FP; in phar_flush_ex()
2742 if (!phar_get_efp(entry, 0)) { in phar_flush_ex()
2744 newentry = phar_open_jit(phar, entry, error); in phar_flush_ex()
2751 entry = newentry; in phar_flush_ex()
2753 file = phar_get_efp(entry, 0); in phar_flush_ex()
2754 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) { in phar_flush_ex()
2760 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
2765 php_crc32_stream_bulk_update(&newcrc32, file, entry->uncompressed_filesize); in phar_flush_ex()
2766 entry->crc32 = php_crc32_bulk_end(newcrc32); in phar_flush_ex()
2767 entry->is_crc_checked = 1; in phar_flush_ex()
2768 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) { in phar_flush_ex()
2770 entry->compressed_filesize = entry->uncompressed_filesize; in phar_flush_ex()
2773 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); in phar_flush_ex()
2779 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_flush_ex()
2781 …spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar… in phar_flush_ex()
2785 …spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, pha… in phar_flush_ex()
2797 entry->cfp = shared_cfp; in phar_flush_ex()
2798 if (!entry->cfp) { in phar_flush_ex()
2809 ZEND_ASSERT(entry->header_offset == 0); in phar_flush_ex()
2810 entry->header_offset = php_stream_tell(entry->cfp); in phar_flush_ex()
2812 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_flush_ex()
2818 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
2822 php_stream_filter_append((&entry->cfp->writefilters), filter); in phar_flush_ex()
2823 …if (SUCCESS != php_stream_copy_to_stream_ex(file, entry->cfp, entry->uncompressed_filesize, NULL))… in phar_flush_ex()
2829 … compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
2834 php_stream_flush(entry->cfp); in phar_flush_ex()
2836 php_stream_seek(entry->cfp, 0, SEEK_END); in phar_flush_ex()
2837 entry->compressed_filesize = ((uint32_t) php_stream_tell(entry->cfp)) - entry->header_offset; in phar_flush_ex()
2839 entry->old_flags = entry->flags; in phar_flush_ex()
2840 entry->is_modified = 1; in phar_flush_ex()
2841 global_flags |= (entry->flags & PHAR_ENT_COMPRESSION_MASK); in phar_flush_ex()
2923 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) { in phar_flush_ex()
2925 if (entry->is_deleted || entry->is_mounted) { in phar_flush_ex()
2930 if (entry->is_dir) { in phar_flush_ex()
2932 phar_set_32(entry_buffer, entry->filename_len + 1); in phar_flush_ex()
2934 phar_set_32(entry_buffer, entry->filename_len); in phar_flush_ex()
2938 || entry->filename_len != php_stream_write(newfile, entry->filename, entry->filename_len) in phar_flush_ex()
2939 || (entry->is_dir && 1 != php_stream_write(newfile, "/", 1))) { in phar_flush_ex()
2945 if (entry->is_dir) { in phar_flush_ex()
2946 …le to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
2948 …"unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
2964 phar_set_32(entry_buffer, entry->uncompressed_filesize); in phar_flush_ex()
2966 phar_set_32(entry_buffer+8, entry->compressed_filesize); in phar_flush_ex()
2967 phar_set_32(entry_buffer+12, entry->crc32); in phar_flush_ex()
2968 phar_set_32(entry_buffer+16, entry->flags); in phar_flush_ex()
2969 metadata_str = entry->metadata_tracker.str; in phar_flush_ex()
2982 … write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
3007 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) { in phar_flush_ex()
3008 if (entry->is_deleted || entry->is_dir || entry->is_mounted) { in phar_flush_ex()
3012 if (entry->cfp) { in phar_flush_ex()
3013 file = entry->cfp; in phar_flush_ex()
3014 php_stream_seek(file, entry->header_offset, SEEK_SET); in phar_flush_ex()
3016 file = phar_get_efp(entry, 0); in phar_flush_ex()
3017 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_flush_ex()
3023 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
3035 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush_ex()
3041 entry->offset = entry->offset_abs = offset; in phar_flush_ex()
3042 offset += entry->compressed_filesize; in phar_flush_ex()
3043 if (php_stream_copy_to_stream_ex(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) { in phar_flush_ex()
3051 …spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, … in phar_flush_ex()
3057 entry->is_modified = 0; in phar_flush_ex()
3059 if (entry->cfp) { in phar_flush_ex()
3060 entry->cfp = NULL; in phar_flush_ex()
3061 entry->header_offset = 0; in phar_flush_ex()
3064 if (entry->fp_type == PHAR_MOD) { in phar_flush_ex()
3066 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) { in phar_flush_ex()
3067 php_stream_close(entry->fp); in phar_flush_ex()
3070 entry->fp = NULL; in phar_flush_ex()
3071 entry->fp_type = PHAR_FP; in phar_flush_ex()
3072 } else if (entry->fp_type == PHAR_UFP) { in phar_flush_ex()
3073 entry->fp_type = PHAR_FP; in phar_flush_ex()
3217 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) { in phar_flush_ex()
3218 if (entry->cfp) { in phar_flush_ex()
3219 entry->cfp = NULL; in phar_flush_ex()
3220 entry->header_offset = 0; in phar_flush_ex()