Lines Matching refs:entry

52 	if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) {  in ZEND_INI_MH()
73 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
82 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
320 phar_entry_info *entry = (phar_entry_info *) Z_PTR_P(zv); in phar_tmpclose_apply() local
322 if (entry->fp_type != PHAR_TMP) { in phar_tmpclose_apply()
326 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
327 php_stream_close(entry->fp); in phar_tmpclose_apply()
328 entry->fp = NULL; in phar_tmpclose_apply()
361 void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */ in destroy_phar_manifest_entry_int() argument
364 if (entry->cfp) { in destroy_phar_manifest_entry_int()
365 php_stream_close(entry->cfp); in destroy_phar_manifest_entry_int()
366 entry->cfp = 0; in destroy_phar_manifest_entry_int()
369 if (entry->fp) { in destroy_phar_manifest_entry_int()
370 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
371 entry->fp = 0; in destroy_phar_manifest_entry_int()
374 phar_metadata_tracker_free(&entry->metadata_tracker, entry->is_persistent); in destroy_phar_manifest_entry_int()
376 pefree(entry->filename, entry->is_persistent); in destroy_phar_manifest_entry_int()
378 if (entry->link) { in destroy_phar_manifest_entry_int()
379 pefree(entry->link, entry->is_persistent); in destroy_phar_manifest_entry_int()
380 entry->link = 0; in destroy_phar_manifest_entry_int()
383 if (entry->tmp) { in destroy_phar_manifest_entry_int()
384 pefree(entry->tmp, entry->is_persistent); in destroy_phar_manifest_entry_int()
385 entry->tmp = 0; in destroy_phar_manifest_entry_int()
392 phar_entry_info *entry = Z_PTR_P(zv); in destroy_phar_manifest_entry() local
393 destroy_phar_manifest_entry_int(entry); in destroy_phar_manifest_entry()
394 pefree(entry, entry->is_persistent); in destroy_phar_manifest_entry()
746 phar_entry_info entry; in phar_parse_pharfile() local
1131 memset(&entry, 0, sizeof(phar_entry_info)); in phar_parse_pharfile()
1132 entry.phar = mydata; in phar_parse_pharfile()
1133 entry.fp_type = PHAR_FP; in phar_parse_pharfile()
1134 entry.is_persistent = mydata->is_persistent; in phar_parse_pharfile()
1141 PHAR_GET_32(buffer, entry.filename_len); in phar_parse_pharfile()
1143 if (entry.filename_len == 0) { in phar_parse_pharfile()
1147 if (entry.is_persistent) { in phar_parse_pharfile()
1148 entry.manifest_pos = manifest_index; in phar_parse_pharfile()
1151 if (entry.filename_len > (size_t)(endbuffer - buffer - 24)) { in phar_parse_pharfile()
1155 …if ((manifest_ver & PHAR_API_VER_MASK) >= PHAR_API_MIN_DIR && buffer[entry.filename_len - 1] == '/… in phar_parse_pharfile()
1156 entry.is_dir = 1; in phar_parse_pharfile()
1158 entry.is_dir = 0; in phar_parse_pharfile()
1161 phar_add_virtual_dirs(mydata, buffer, entry.filename_len); in phar_parse_pharfile()
1162 entry.filename = pestrndup(buffer, entry.filename_len, entry.is_persistent); in phar_parse_pharfile()
1163 buffer += entry.filename_len; in phar_parse_pharfile()
1164 PHAR_GET_32(buffer, entry.uncompressed_filesize); in phar_parse_pharfile()
1165 PHAR_GET_32(buffer, entry.timestamp); in phar_parse_pharfile()
1168 mydata->min_timestamp = entry.timestamp; in phar_parse_pharfile()
1169 mydata->max_timestamp = entry.timestamp; in phar_parse_pharfile()
1171 if (mydata->min_timestamp > entry.timestamp) { in phar_parse_pharfile()
1172 mydata->min_timestamp = entry.timestamp; in phar_parse_pharfile()
1173 } else if (mydata->max_timestamp < entry.timestamp) { in phar_parse_pharfile()
1174 mydata->max_timestamp = entry.timestamp; in phar_parse_pharfile()
1178 PHAR_GET_32(buffer, entry.compressed_filesize); in phar_parse_pharfile()
1179 PHAR_GET_32(buffer, entry.crc32); in phar_parse_pharfile()
1180 PHAR_GET_32(buffer, entry.flags); in phar_parse_pharfile()
1182 if (entry.is_dir) { in phar_parse_pharfile()
1183 entry.filename_len--; in phar_parse_pharfile()
1184 entry.flags |= PHAR_ENT_PERM_DEF_DIR; in phar_parse_pharfile()
1189 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1194 ZVAL_UNDEF(&entry.metadata_tracker.val); in phar_parse_pharfile()
1195 entry.metadata_tracker.str = NULL; in phar_parse_pharfile()
1196 phar_parse_metadata_lazy(buffer, &entry.metadata_tracker, len, entry.is_persistent); in phar_parse_pharfile()
1199 entry.offset = entry.offset_abs = offset; in phar_parse_pharfile()
1200 offset += entry.compressed_filesize; in phar_parse_pharfile()
1202 switch (entry.flags & PHAR_ENT_COMPRESSION_MASK) { in phar_parse_pharfile()
1205 phar_metadata_tracker_free(&entry.metadata_tracker, entry.is_persistent); in phar_parse_pharfile()
1206 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1212 phar_metadata_tracker_free(&entry.metadata_tracker, entry.is_persistent); in phar_parse_pharfile()
1213 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1218 if (entry.uncompressed_filesize != entry.compressed_filesize) { in phar_parse_pharfile()
1219 phar_metadata_tracker_free(&entry.metadata_tracker, entry.is_persistent); in phar_parse_pharfile()
1220 pefree(entry.filename, entry.is_persistent); in phar_parse_pharfile()
1226 manifest_flags |= (entry.flags & PHAR_ENT_COMPRESSION_MASK); in phar_parse_pharfile()
1228 entry.is_crc_checked = (manifest_flags & PHAR_HDR_SIGNATURE ? 1 : 0); in phar_parse_pharfile()
1229 phar_set_inode(&entry); in phar_parse_pharfile()
1231 str = zend_string_init_interned(entry.filename, entry.filename_len, 1); in phar_parse_pharfile()
1233 str = zend_string_init(entry.filename, entry.filename_len, 0); in phar_parse_pharfile()
1235 zend_hash_add_mem(&mydata->manifest, str, (void*)&entry, sizeof(phar_entry_info)); in phar_parse_pharfile()
2251 …har *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len… in phar_split_fname() argument
2304 *entry = estrndup(ext_str+ext_len, *entry_len); in phar_split_fname()
2306 phar_unixify_path_separators(*entry, *entry_len); in phar_split_fname()
2308 *entry = phar_fix_filepath(*entry, entry_len, 0); in phar_split_fname()
2311 *entry = estrndup("/", 1); in phar_split_fname()
2400 phar_entry_info *entry = idata->internal_file; in phar_postprocess_file() local
2406 if (entry->is_zip && process_zip > 0) { in phar_postprocess_file()
2412 … archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename); in phar_postprocess_file()
2415 php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET); in phar_postprocess_file()
2419 …phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2426 entry->header_offset + sizeof(local) + in phar_postprocess_file()
2429 entry->compressed_filesize, SEEK_SET); in phar_postprocess_file()
2432 … \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2443entry->filename_len != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32)… in phar_postprocess_file()
2444 …cal header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename); in phar_postprocess_file()
2449 entry->offset = entry->offset_abs = in phar_postprocess_file()
2450 …sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_l… in phar_postprocess_file()
2452 if (idata->zero && idata->zero != entry->offset_abs) { in phar_postprocess_file()
2453 idata->zero = entry->offset_abs; in phar_postprocess_file()
2470 entry->is_crc_checked = 1; in phar_postprocess_file()
2473 …l corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename); in phar_postprocess_file()
2493 phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); in phar_flush_clean_deleted_apply() local
2495 if (entry->fp_refcount <= 0 && entry->is_deleted) { in phar_flush_clean_deleted_apply()
2555 phar_entry_info *entry, *newentry; in phar_flush() local
2746 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
2747 if (entry->cfp) { in phar_flush()
2749 php_stream_close(entry->cfp); in phar_flush()
2750 entry->cfp = 0; in phar_flush()
2752 if (entry->is_deleted || entry->is_mounted) { in phar_flush()
2756 if (!entry->is_modified && entry->fp_refcount) { in phar_flush()
2758 switch (entry->fp_type) { in phar_flush()
2770 phar_add_virtual_dirs(phar, entry->filename, entry->filename_len); in phar_flush()
2772 if (entry->is_dir) { in phar_flush()
2776 if (!Z_ISUNDEF(entry->metadata_tracker.val) && !entry->metadata_tracker.str) { in phar_flush()
2777 ZEND_ASSERT(!entry->is_persistent); in phar_flush()
2781 php_var_serialize(&buf, &entry->metadata_tracker.val, &metadata_hash); in phar_flush()
2783 entry->metadata_tracker.str = buf.s; in phar_flush()
2787 …ffset += 4 + entry->filename_len + sizeof(entry_buffer) + (entry->metadata_tracker.str ? ZSTR_LEN( in phar_flush()
2790 if ((oldfile && !entry->is_modified) || entry->is_dir) { in phar_flush()
2791 if (entry->fp_type == PHAR_UFP) { in phar_flush()
2793 entry->fp_type = PHAR_FP; in phar_flush()
2797 if (!phar_get_efp(entry, 0)) { in phar_flush()
2799 newentry = phar_open_jit(phar, entry, error); in phar_flush()
2806 entry = newentry; in phar_flush()
2808 file = phar_get_efp(entry, 0); in phar_flush()
2809 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) { in phar_flush()
2815 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2820 mytime = entry->uncompressed_filesize; in phar_flush()
2824 entry->crc32 = ~newcrc32; in phar_flush()
2825 entry->is_crc_checked = 1; in phar_flush()
2826 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) { in phar_flush()
2828 entry->compressed_filesize = entry->uncompressed_filesize; in phar_flush()
2831 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); in phar_flush()
2837 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_flush()
2839 …spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar… in phar_flush()
2843 …spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, pha… in phar_flush()
2855 entry->cfp = shared_cfp; in phar_flush()
2856 if (!entry->cfp) { in phar_flush()
2867 ZEND_ASSERT(entry->header_offset == 0); in phar_flush()
2868 entry->header_offset = php_stream_tell(entry->cfp); in phar_flush()
2870 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_flush()
2876 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2880 php_stream_filter_append((&entry->cfp->writefilters), filter); in phar_flush()
2881 …if (SUCCESS != php_stream_copy_to_stream_ex(file, entry->cfp, entry->uncompressed_filesize, NULL))… in phar_flush()
2887 … compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
2892 php_stream_flush(entry->cfp); in phar_flush()
2894 php_stream_seek(entry->cfp, 0, SEEK_END); in phar_flush()
2895 entry->compressed_filesize = ((uint32_t) php_stream_tell(entry->cfp)) - entry->header_offset; in phar_flush()
2897 entry->old_flags = entry->flags; in phar_flush()
2898 entry->is_modified = 1; in phar_flush()
2899 global_flags |= (entry->flags & PHAR_ENT_COMPRESSION_MASK); in phar_flush()
2981 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
2983 if (entry->is_deleted || entry->is_mounted) { in phar_flush()
2988 if (entry->is_dir) { in phar_flush()
2990 phar_set_32(entry_buffer, entry->filename_len + 1); in phar_flush()
2992 phar_set_32(entry_buffer, entry->filename_len); in phar_flush()
2996 || entry->filename_len != php_stream_write(newfile, entry->filename, entry->filename_len) in phar_flush()
2997 || (entry->is_dir && 1 != php_stream_write(newfile, "/", 1))) { in phar_flush()
3003 if (entry->is_dir) { in phar_flush()
3004 …le to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3006 …"unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3022 phar_set_32(entry_buffer, entry->uncompressed_filesize); in phar_flush()
3024 phar_set_32(entry_buffer+8, entry->compressed_filesize); in phar_flush()
3025 phar_set_32(entry_buffer+12, entry->crc32); in phar_flush()
3026 phar_set_32(entry_buffer+16, entry->flags); in phar_flush()
3027 metadata_str = entry->metadata_tracker.str; in phar_flush()
3040 … write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3065 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
3066 if (entry->is_deleted || entry->is_dir || entry->is_mounted) { in phar_flush()
3070 if (entry->cfp) { in phar_flush()
3071 file = entry->cfp; in phar_flush()
3072 php_stream_seek(file, entry->header_offset, SEEK_SET); in phar_flush()
3074 file = phar_get_efp(entry, 0); in phar_flush()
3075 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_flush()
3081 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3093 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f… in phar_flush()
3099 entry->offset = entry->offset_abs = offset; in phar_flush()
3100 offset += entry->compressed_filesize; in phar_flush()
3101 if (php_stream_copy_to_stream_ex(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) { in phar_flush()
3109 …spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, … in phar_flush()
3115 entry->is_modified = 0; in phar_flush()
3117 if (entry->cfp) { in phar_flush()
3118 entry->cfp = NULL; in phar_flush()
3119 entry->header_offset = 0; in phar_flush()
3122 if (entry->fp_type == PHAR_MOD) { in phar_flush()
3124 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) { in phar_flush()
3125 php_stream_close(entry->fp); in phar_flush()
3128 entry->fp = NULL; in phar_flush()
3129 entry->fp_type = PHAR_FP; in phar_flush()
3130 } else if (entry->fp_type == PHAR_UFP) { in phar_flush()
3131 entry->fp_type = PHAR_FP; in phar_flush()
3275 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { in phar_flush()
3276 if (entry->cfp) { in phar_flush()
3277 entry->cfp = NULL; in phar_flush()
3278 entry->header_offset = 0; in phar_flush()