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()
336 phar_entry_info *entry = (phar_entry_info *) Z_PTR_P(zv); in phar_tmpclose_apply() local
338 if (entry->fp_type != PHAR_TMP) { in phar_tmpclose_apply()
342 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
343 php_stream_close(entry->fp); in phar_tmpclose_apply()
344 entry->fp = NULL; in phar_tmpclose_apply()
377 void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */ in destroy_phar_manifest_entry_int() argument
380 if (entry->cfp) { in destroy_phar_manifest_entry_int()
381 php_stream_close(entry->cfp); in destroy_phar_manifest_entry_int()
382 entry->cfp = 0; in destroy_phar_manifest_entry_int()
385 if (entry->fp) { in destroy_phar_manifest_entry_int()
386 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
387 entry->fp = 0; in destroy_phar_manifest_entry_int()
390 if (Z_TYPE(entry->metadata) != IS_UNDEF) { in destroy_phar_manifest_entry_int()
391 if (entry->is_persistent) { in destroy_phar_manifest_entry_int()
392 if (entry->metadata_len) { in destroy_phar_manifest_entry_int()
394 free(Z_PTR(entry->metadata)); in destroy_phar_manifest_entry_int()
396 zval_internal_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry_int()
399 zval_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry_int()
401 entry->metadata_len = 0; in destroy_phar_manifest_entry_int()
402 ZVAL_UNDEF(&entry->metadata); in destroy_phar_manifest_entry_int()
405 if (entry->metadata_str.s) { in destroy_phar_manifest_entry_int()
406 smart_str_free(&entry->metadata_str); in destroy_phar_manifest_entry_int()
407 entry->metadata_str.s = NULL; in destroy_phar_manifest_entry_int()
410 pefree(entry->filename, entry->is_persistent); in destroy_phar_manifest_entry_int()
412 if (entry->link) { in destroy_phar_manifest_entry_int()
413 pefree(entry->link, entry->is_persistent); in destroy_phar_manifest_entry_int()
414 entry->link = 0; in destroy_phar_manifest_entry_int()
417 if (entry->tmp) { in destroy_phar_manifest_entry_int()
418 pefree(entry->tmp, entry->is_persistent); in destroy_phar_manifest_entry_int()
419 entry->tmp = 0; in destroy_phar_manifest_entry_int()
426 phar_entry_info *entry = Z_PTR_P(zv); in destroy_phar_manifest_entry() local
427 destroy_phar_manifest_entry_int(entry); in destroy_phar_manifest_entry()
428 pefree(entry, entry->is_persistent); in destroy_phar_manifest_entry()
668 phar_entry_info entry; local
1067 memset(&entry, 0, sizeof(phar_entry_info));
1068 entry.phar = mydata;
1069 entry.fp_type = PHAR_FP;
1070 entry.is_persistent = mydata->is_persistent;
1077 PHAR_GET_32(buffer, entry.filename_len);
1079 if (entry.filename_len == 0) {
1083 if (entry.is_persistent) {
1084 entry.manifest_pos = manifest_index;
1087 if (entry.filename_len > (size_t)(endbuffer - buffer - 24)) {
1091 …if ((manifest_ver & PHAR_API_VER_MASK) >= PHAR_API_MIN_DIR && buffer[entry.filename_len - 1] == '/…
1092 entry.is_dir = 1;
1094 entry.is_dir = 0;
1097 phar_add_virtual_dirs(mydata, buffer, entry.filename_len);
1098 entry.filename = pestrndup(buffer, entry.filename_len, entry.is_persistent);
1099 buffer += entry.filename_len;
1100 PHAR_GET_32(buffer, entry.uncompressed_filesize);
1101 PHAR_GET_32(buffer, entry.timestamp);
1104 mydata->min_timestamp = entry.timestamp;
1105 mydata->max_timestamp = entry.timestamp;
1107 if (mydata->min_timestamp > entry.timestamp) {
1108 mydata->min_timestamp = entry.timestamp;
1109 } else if (mydata->max_timestamp < entry.timestamp) {
1110 mydata->max_timestamp = entry.timestamp;
1114 PHAR_GET_32(buffer, entry.compressed_filesize);
1115 PHAR_GET_32(buffer, entry.crc32);
1116 PHAR_GET_32(buffer, entry.flags);
1118 if (entry.is_dir) {
1119 entry.filename_len--;
1120 entry.flags |= PHAR_ENT_PERM_DEF_DIR;
1124 if (entry.is_persistent) {
1125 entry.metadata_len = len;
1127 entry.metadata_len = 0;
1130 pefree(entry.filename, entry.is_persistent);
1133 if (phar_parse_metadata(&buffer, &entry.metadata, len) == FAILURE) {
1134 pefree(entry.filename, entry.is_persistent);
1139 entry.offset = entry.offset_abs = offset;
1140 offset += entry.compressed_filesize;
1142 switch (entry.flags & PHAR_ENT_COMPRESSION_MASK) {
1145 if (Z_TYPE(entry.metadata) != IS_UNDEF) {
1146 if (entry.is_persistent) {
1147 free(Z_PTR(entry.metadata));
1149 zval_ptr_dtor(&entry.metadata);
1152 pefree(entry.filename, entry.is_persistent);
1158 if (Z_TYPE(entry.metadata) != IS_UNDEF) {
1159 if (entry.is_persistent) {
1160 free(Z_PTR(entry.metadata));
1162 zval_ptr_dtor(&entry.metadata);
1165 pefree(entry.filename, entry.is_persistent);
1170 if (entry.uncompressed_filesize != entry.compressed_filesize) {
1171 if (Z_TYPE(entry.metadata) != IS_UNDEF) {
1172 if (entry.is_persistent) {
1173 free(Z_PTR(entry.metadata));
1175 zval_ptr_dtor(&entry.metadata);
1178 pefree(entry.filename, entry.is_persistent);
1184 manifest_flags |= (entry.flags & PHAR_ENT_COMPRESSION_MASK);
1186 entry.is_crc_checked = (manifest_flags & PHAR_HDR_SIGNATURE ? 1 : 0);
1187 phar_set_inode(&entry);
1189 str = zend_string_init_interned(entry.filename, entry.filename_len, 1);
1191 str = zend_string_init(entry.filename, entry.filename_len, 0);
1193 zend_hash_add_mem(&mydata->manifest, str, (void*)&entry, sizeof(phar_entry_info));
2213 …har *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len… argument
2262 *entry = estrndup(ext_str+ext_len, *entry_len);
2264 phar_unixify_path_separators(*entry, *entry_len);
2266 *entry = phar_fix_filepath(*entry, entry_len, 0);
2269 *entry = estrndup("/", 1);
2356 phar_entry_info *entry = idata->internal_file; local
2362 if (entry->is_zip && process_zip > 0) {
2368 … archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename);
2371 php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET);
2375 …phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename);
2382 entry->header_offset + sizeof(local) +
2385 entry->compressed_filesize, SEEK_SET);
2388 … \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename);
2399entry->filename_len != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32)…
2400 …cal header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename);
2405 entry->offset = entry->offset_abs =
2406 …sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_l…
2408 if (idata->zero && idata->zero != entry->offset_abs) {
2409 idata->zero = entry->offset_abs;
2426 entry->is_crc_checked = 1;
2429 …l corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename);
2449 phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); local
2451 if (entry->fp_refcount <= 0 && entry->is_deleted) {
2511 phar_entry_info *entry, *newentry; local
2702 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
2705 if (entry->cfp) {
2707 php_stream_close(entry->cfp);
2708 entry->cfp = 0;
2710 if (entry->is_deleted || entry->is_mounted) {
2714 if (!entry->is_modified && entry->fp_refcount) {
2716 switch (entry->fp_type) {
2728 phar_add_virtual_dirs(phar, entry->filename, entry->filename_len);
2730 if (entry->is_dir) {
2734 if (Z_TYPE(entry->metadata) != IS_UNDEF) {
2735 if (entry->metadata_str.s) {
2736 smart_str_free(&entry->metadata_str);
2738 entry->metadata_str.s = NULL;
2740 php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash);
2743 if (entry->metadata_str.s) {
2744 smart_str_free(&entry->metadata_str);
2746 entry->metadata_str.s = NULL;
2750 …offset += 4 + entry->filename_len + sizeof(entry_buffer) + (entry->metadata_str.s ? ZSTR_LEN(entry
2753 if ((oldfile && !entry->is_modified) || entry->is_dir) {
2754 if (entry->fp_type == PHAR_UFP) {
2756 entry->fp_type = PHAR_FP;
2760 if (!phar_get_efp(entry, 0)) {
2762 newentry = phar_open_jit(phar, entry, error);
2769 entry = newentry;
2771 file = phar_get_efp(entry, 0);
2772 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) {
2778 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2783 mytime = entry->uncompressed_filesize;
2787 entry->crc32 = ~newcrc32;
2788 entry->is_crc_checked = 1;
2789 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) {
2791 entry->compressed_filesize = entry->uncompressed_filesize;
2794 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0);
2800 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
2802 …spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar…
2806 …spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, pha…
2815 entry->cfp = php_stream_fopen_tmpfile();
2816 if (!entry->cfp) {
2827 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
2833 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2837 php_stream_filter_append((&entry->cfp->writefilters), filter);
2838 …if (SUCCESS != php_stream_copy_to_stream_ex(file, entry->cfp, entry->uncompressed_filesize, NULL))…
2844 … compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2849 php_stream_flush(entry->cfp);
2851 php_stream_seek(entry->cfp, 0, SEEK_END);
2852 entry->compressed_filesize = (uint32_t) php_stream_tell(entry->cfp);
2854 php_stream_rewind(entry->cfp);
2855 entry->old_flags = entry->flags;
2856 entry->is_modified = 1;
2857 global_flags |= (entry->flags & PHAR_ENT_COMPRESSION_MASK);
2943 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
2947 if (entry->is_deleted || entry->is_mounted) {
2952 if (entry->is_dir) {
2954 phar_set_32(entry_buffer, entry->filename_len + 1);
2956 phar_set_32(entry_buffer, entry->filename_len);
2960 || entry->filename_len != php_stream_write(newfile, entry->filename, entry->filename_len)
2961 || (entry->is_dir && 1 != php_stream_write(newfile, "/", 1))) {
2967 if (entry->is_dir) {
2968 …le to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
2970 …"unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
2986 phar_set_32(entry_buffer, entry->uncompressed_filesize);
2988 phar_set_32(entry_buffer+8, entry->compressed_filesize);
2989 phar_set_32(entry_buffer+12, entry->crc32);
2990 phar_set_32(entry_buffer+16, entry->flags);
2991 phar_set_32(entry_buffer+20, entry->metadata_str.s ? ZSTR_LEN(entry->metadata_str.s) : 0);
2994 || (entry->metadata_str.s &&
2995 …ZSTR_LEN(entry->metadata_str.s) != php_stream_write(newfile, ZSTR_VAL(entry->metadata_str.s), ZSTR…
3003 … write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
3032 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
3036 if (entry->is_deleted || entry->is_dir || entry->is_mounted) {
3040 if (entry->cfp) {
3041 file = entry->cfp;
3044 file = phar_get_efp(entry, 0);
3045 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
3051 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3063 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3069 entry->offset = entry->offset_abs = offset;
3070 offset += entry->compressed_filesize;
3071 if (php_stream_copy_to_stream_ex(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) {
3079 …spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, …
3085 entry->is_modified = 0;
3087 if (entry->cfp) {
3088 php_stream_close(entry->cfp);
3089 entry->cfp = NULL;
3092 if (entry->fp_type == PHAR_MOD) {
3094 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
3095 php_stream_close(entry->fp);
3098 entry->fp = NULL;
3099 entry->fp_type = PHAR_FP;
3100 } else if (entry->fp_type == PHAR_UFP) {
3101 entry->fp_type = PHAR_FP;
3125 …ite contents of file \"%s\" to new phar \"%s\" with requested hash type", entry->filename, phar->f…