Lines Matching refs:entry
44 static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, uint16_t len) /* {{{ */ in phar_zip_process_extra() argument
73 entry->timestamp = PHAR_GET_32(h.time.time); in phar_zip_process_extra()
108 entry->flags &= PHAR_ENT_COMPRESSION_MASK; in phar_zip_process_extra()
110 if (entry->is_dir) { in phar_zip_process_extra()
111 entry->flags |= PHAR_GET_16(h.unix3.perms) & PHAR_ENT_PERM_MASK; in phar_zip_process_extra()
113 entry->flags |= PHAR_GET_16(h.unix3.perms) & PHAR_ENT_PERM_MASK; in phar_zip_process_extra()
236 phar_entry_info entry = {0}; in phar_parse_zipfile() local
344 entry.phar = mydata; in phar_parse_zipfile()
345 entry.is_zip = 1; in phar_parse_zipfile()
346 entry.fp_type = PHAR_FP; in phar_parse_zipfile()
347 entry.is_persistent = mydata->is_persistent; in phar_parse_zipfile()
397 ZVAL_UNDEF(&entry.metadata_tracker.val); in phar_parse_zipfile()
398 entry.metadata_tracker.str = NULL; in phar_parse_zipfile()
410 if (entry.is_persistent) { in phar_parse_zipfile()
411 entry.manifest_pos = i; in phar_parse_zipfile()
414 entry.compressed_filesize = PHAR_GET_32(zipentry.compsize); in phar_parse_zipfile()
415 entry.uncompressed_filesize = PHAR_GET_32(zipentry.uncompsize); in phar_parse_zipfile()
416 entry.crc32 = PHAR_GET_32(zipentry.crc32); in phar_parse_zipfile()
418 entry.timestamp = phar_zip_d2u_time(zipentry.timestamp, zipentry.datestamp); in phar_parse_zipfile()
419 entry.flags = PHAR_ENT_PERM_DEF_FILE; in phar_parse_zipfile()
420 entry.header_offset = PHAR_GET_32(zipentry.offset); in phar_parse_zipfile()
430 entry.filename_len = PHAR_GET_16(zipentry.filename_len); in phar_parse_zipfile()
431 entry.filename = (char *) pemalloc(entry.filename_len + 1, entry.is_persistent); in phar_parse_zipfile()
433 if (entry.filename_len != php_stream_read(fp, entry.filename, entry.filename_len)) { in phar_parse_zipfile()
434 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
438 entry.filename[entry.filename_len] = '\0'; in phar_parse_zipfile()
440 if (entry.filename[entry.filename_len - 1] == '/') { in phar_parse_zipfile()
441 entry.is_dir = 1; in phar_parse_zipfile()
442 if(entry.filename_len > 1) { in phar_parse_zipfile()
443 entry.filename_len--; in phar_parse_zipfile()
445 entry.flags |= PHAR_ENT_PERM_DEF_DIR; in phar_parse_zipfile()
447 entry.is_dir = 0; in phar_parse_zipfile()
451 if (!entry.is_dir) { in phar_parse_zipfile()
459 php_stream_seek(fp, entry.header_offset, SEEK_SET); in phar_parse_zipfile()
461 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
470 if (entry.filename_len != PHAR_GET_16(local.filename_len)) { in phar_parse_zipfile()
471 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
475 entry.offset = entry.offset_abs = entry.header_offset in phar_parse_zipfile()
477 + entry.filename_len in phar_parse_zipfile()
480 entry.offset = entry.offset_abs = entry.header_offset in phar_parse_zipfile()
482 + entry.filename_len in phar_parse_zipfile()
486 …if (entry.filename_len == sizeof(".phar/signature.bin")-1 && !strncmp(entry.filename, ".phar/signa… in phar_parse_zipfile()
492 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
494 if (entry.uncompressed_filesize > 0x10000) { in phar_parse_zipfile()
505 php_stream_copy_to_stream_ex(fp, sigfile, entry.header_offset, NULL); in phar_parse_zipfile()
513 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
514 sig = (char *) emalloc(entry.uncompressed_filesize); in phar_parse_zipfile()
515 read = php_stream_read(fp, sig, entry.uncompressed_filesize); in phar_parse_zipfile()
516 if (read != entry.uncompressed_filesize || read <= 8) { in phar_parse_zipfile()
522 …_signature(sigfile, php_stream_tell(sigfile), mydata->sig_flags, sig + 8, entry.uncompressed_files… in phar_parse_zipfile()
546 phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len); in phar_parse_zipfile()
550 if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len))) { in phar_parse_zipfile()
551 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
562 entry.flags |= PHAR_ENT_COMPRESSED_GZ; in phar_parse_zipfile()
564 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
569 entry.flags |= PHAR_ENT_COMPRESSED_BZ2; in phar_parse_zipfile()
571 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
576 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
582 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
585 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
588 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
591 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
594 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
597 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
600 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
603 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
606 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
609 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
612 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
619 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
624 …phar_parse_metadata_lazy(buf, &entry.metadata_tracker, PHAR_GET_16(zipentry.comment_len), entry.is… in phar_parse_zipfile()
626 ZVAL_UNDEF(&entry.metadata_tracker.val); in phar_parse_zipfile()
629 …if (!actual_alias && entry.filename_len == sizeof(".phar/alias.txt")-1 && !strncmp(entry.filename,… in phar_parse_zipfile()
635 ZEND_ASSERT(!entry.is_dir); in phar_parse_zipfile()
636 …if (entry.crc32 != PHAR_GET_32(local.crc32) || entry.uncompressed_filesize != PHAR_GET_32(local.un… in phar_parse_zipfile()
637 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
642 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
646 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
651 mydata->alias_len = entry.uncompressed_filesize; in phar_parse_zipfile()
652 if (entry.flags & PHAR_ENT_COMPRESSED_GZ) { in phar_parse_zipfile()
656 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
665 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
667 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
672 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
676 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
677 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
684 } else if (entry.flags & PHAR_ENT_COMPRESSED_BZ2) { in phar_parse_zipfile()
688 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
697 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
699 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
704 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
708 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
709 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
719 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
721 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
726 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
730 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
731 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
740 phar_set_inode(&entry); in phar_parse_zipfile()
741 …zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void *)&entry, sizeo… in phar_parse_zipfile()
784 …mydata->alias = entry.is_persistent ? pestrndup(actual_alias, mydata->alias_len, 1) : actual_alias; in phar_parse_zipfile()
786 if (entry.is_persistent) { in phar_parse_zipfile()
870 static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ */ in phar_zip_changed_apply_int() argument
882 if (entry->is_mounted) { in phar_zip_changed_apply_int()
886 if (entry->is_deleted) { in phar_zip_changed_apply_int()
887 if (entry->fp_refcount <= 0) { in phar_zip_changed_apply_int()
895 phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len); in phar_zip_changed_apply_int()
906 PHAR_SET_16(perms.perms, entry->flags & PHAR_ENT_PERM_MASK); in phar_zip_changed_apply_int()
914 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_zip_changed_apply_int()
919 if (entry->flags & PHAR_ENT_COMPRESSED_BZ2) { in phar_zip_changed_apply_int()
925 phar_zip_u2d_time(entry->timestamp, local.timestamp, local.datestamp); in phar_zip_changed_apply_int()
928 PHAR_SET_16(central.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); in phar_zip_changed_apply_int()
929 PHAR_SET_16(local.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); in phar_zip_changed_apply_int()
938 if (entry->is_modified) { in phar_zip_changed_apply_int()
942 if (entry->is_dir) { in phar_zip_changed_apply_int()
943 entry->is_modified = 0; in phar_zip_changed_apply_int()
944 … if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) { in phar_zip_changed_apply_int()
945 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
946 entry->fp = NULL; in phar_zip_changed_apply_int()
947 entry->fp_type = PHAR_FP; in phar_zip_changed_apply_int()
952 if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { in phar_zip_changed_apply_int()
953 … to open file contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
958 …if (entry->flags & PHAR_ENT_COMPRESSION_MASK && (entry->old_flags == entry->flags || !entry->old_f… in phar_zip_changed_apply_int()
963 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_zip_changed_apply_int()
964 …nable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
968 efp = phar_get_efp(entry, 0); in phar_zip_changed_apply_int()
971 php_crc32_stream_bulk_update(&newcrc32, efp, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
973 entry->crc32 = php_crc32_bulk_end(newcrc32); in phar_zip_changed_apply_int()
974 PHAR_SET_32(central.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
975 PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
977 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) { in phar_zip_changed_apply_int()
979 entry->compressed_filesize = entry->uncompressed_filesize; in phar_zip_changed_apply_int()
980 PHAR_SET_32(central.compsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
981 PHAR_SET_32(local.compsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
985 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); in phar_zip_changed_apply_int()
988 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_zip_changed_apply_int()
989 … "unable to gzip compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
991 …"unable to bzip2 compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
999 entry->cfp = php_stream_fopen_tmpfile(); in phar_zip_changed_apply_int()
1001 if (!entry->cfp) { in phar_zip_changed_apply_int()
1002 …rary file for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1008 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_zip_changed_apply_int()
1009 …nable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1013 php_stream_filter_append((&entry->cfp->writefilters), filter); in phar_zip_changed_apply_int()
1015 …if (SUCCESS != php_stream_copy_to_stream_ex(efp, entry->cfp, entry->uncompressed_filesize, NULL)) { in phar_zip_changed_apply_int()
1016 …ed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1021 php_stream_flush(entry->cfp); in phar_zip_changed_apply_int()
1023 php_stream_seek(entry->cfp, 0, SEEK_END); in phar_zip_changed_apply_int()
1024 entry->compressed_filesize = (uint32_t) php_stream_tell(entry->cfp); in phar_zip_changed_apply_int()
1025 PHAR_SET_32(central.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
1026 PHAR_SET_32(local.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
1028 php_stream_rewind(entry->cfp); in phar_zip_changed_apply_int()
1029 entry->old_flags = entry->flags; in phar_zip_changed_apply_int()
1030 entry->is_modified = 1; in phar_zip_changed_apply_int()
1033 PHAR_SET_32(central.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
1034 PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
1035 PHAR_SET_32(central.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
1036 PHAR_SET_32(local.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
1038 if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) { in phar_zip_changed_apply_int()
1039 …k to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1045 PHAR_SET_32(central.crc32, entry->crc32); in phar_zip_changed_apply_int()
1046 PHAR_SET_32(local.crc32, entry->crc32); in phar_zip_changed_apply_int()
1049 if (phar_metadata_tracker_has_data(&entry->metadata_tracker, entry->is_persistent)) { in phar_zip_changed_apply_int()
1050 …phar_metadata_tracker_try_ensure_has_serialized_data(&entry->metadata_tracker, entry->is_persisten… in phar_zip_changed_apply_int()
1051 …PHAR_SET_16(central.comment_len, entry->metadata_tracker.str ? ZSTR_LEN(entry->metadata_tracker.st… in phar_zip_changed_apply_int()
1054 entry->header_offset = php_stream_tell(p->filefp); in phar_zip_changed_apply_int()
1055 …offset = entry->header_offset + sizeof(local) + entry->filename_len + (entry->is_dir ? 1 : 0) + si… in phar_zip_changed_apply_int()
1058 …rite local file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1063 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1067 if (entry->is_dir) { in phar_zip_changed_apply_int()
1068 if (entry->filename_len != php_stream_write(p->filefp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1069 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1074 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1078 if (entry->filename_len != php_stream_write(p->centralfp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1079 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1084 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1088 if (entry->filename_len != php_stream_write(p->filefp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1089 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1093 if (entry->filename_len != php_stream_write(p->centralfp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1094 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1100 …ermissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1105 …ermissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1109 if (!not_really_modified && entry->is_modified) { in phar_zip_changed_apply_int()
1110 if (entry->cfp) { in phar_zip_changed_apply_int()
1111 …if (SUCCESS != php_stream_copy_to_stream_ex(entry->cfp, p->filefp, entry->compressed_filesize, NUL… in phar_zip_changed_apply_int()
1112 …te compressed contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1116 php_stream_close(entry->cfp); in phar_zip_changed_apply_int()
1117 entry->cfp = NULL; in phar_zip_changed_apply_int()
1119 if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { in phar_zip_changed_apply_int()
1123 phar_seek_efp(entry, 0, SEEK_SET, 0, 0); in phar_zip_changed_apply_int()
1125 …if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), p->filefp, entry->uncompressed… in phar_zip_changed_apply_int()
1126 …able to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1131 …if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp &&… in phar_zip_changed_apply_int()
1132 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
1135 entry->is_modified = 0; in phar_zip_changed_apply_int()
1137 entry->is_modified = 0; in phar_zip_changed_apply_int()
1138 if (entry->fp_refcount) { in phar_zip_changed_apply_int()
1140 switch (entry->fp_type) { in phar_zip_changed_apply_int()
1151 …if (!entry->is_dir && entry->compressed_filesize && SUCCESS != php_stream_copy_to_stream_ex(p->old… in phar_zip_changed_apply_int()
1152 …y contents of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1157 entry->fp = NULL; in phar_zip_changed_apply_int()
1158 entry->offset = entry->offset_abs = offset; in phar_zip_changed_apply_int()
1159 entry->fp_type = PHAR_FP; in phar_zip_changed_apply_int()
1161 if (entry->metadata_tracker.str) { in phar_zip_changed_apply_int()
1162 …if (ZSTR_LEN(entry->metadata_tracker.str) != php_stream_write(p->centralfp, ZSTR_VAL(entry->metada… in phar_zip_changed_apply_int()
1163 …e comment for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1184 phar_entry_info entry = {0}; in phar_zip_applysignature() local
1215 entry.filename = ".phar/signature.bin"; in phar_zip_applysignature()
1216 entry.filename_len = sizeof(".phar/signature.bin")-1; in phar_zip_applysignature()
1217 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_applysignature()
1218 entry.fp_type = PHAR_MOD; in phar_zip_applysignature()
1219 entry.is_modified = 1; in phar_zip_applysignature()
1220 if (entry.fp == NULL) { in phar_zip_applysignature()
1228 …if (Z_UL(8) != php_stream_write(entry.fp, sigbuf, 8) || signature_length != php_stream_write(entry… in phar_zip_applysignature()
1239 entry.uncompressed_filesize = entry.compressed_filesize = signature_length + 8; in phar_zip_applysignature()
1240 entry.phar = phar; in phar_zip_applysignature()
1242 phar_zip_changed_apply_int(&entry, (void *)pass); in phar_zip_applysignature()
1261 phar_entry_info entry = {0}; in phar_zip_flush() local
1268 entry.flags = PHAR_ENT_PERM_DEF_FILE; in phar_zip_flush()
1269 entry.timestamp = time(NULL); in phar_zip_flush()
1270 entry.is_modified = 1; in phar_zip_flush()
1271 entry.is_zip = true; in phar_zip_flush()
1272 entry.phar = phar; in phar_zip_flush()
1273 entry.fp_type = PHAR_MOD; in phar_zip_flush()
1288 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1289 if (entry.fp == NULL) { in phar_zip_flush()
1293 if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) { in phar_zip_flush()
1300 entry.uncompressed_filesize = entry.compressed_filesize = phar->alias_len; in phar_zip_flush()
1301 entry.filename = estrndup(".phar/alias.txt", sizeof(".phar/alias.txt")-1); in phar_zip_flush()
1302 entry.filename_len = sizeof(".phar/alias.txt")-1; in phar_zip_flush()
1304 …zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeo… in phar_zip_flush()
1331 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1332 if (entry.fp == NULL) { in phar_zip_flush()
1336 entry.uncompressed_filesize = len + end_sequence_len; in phar_zip_flush()
1339 len != php_stream_write(entry.fp, ZSTR_VAL(user_stub), len) in phar_zip_flush()
1340 || end_sequence_len != php_stream_write(entry.fp, end_sequence, end_sequence_len) in phar_zip_flush()
1345 php_stream_close(entry.fp); in phar_zip_flush()
1349 entry.filename = estrndup(".phar/stub.php", sizeof(".phar/stub.php")-1); in phar_zip_flush()
1350 entry.filename_len = sizeof(".phar/stub.php")-1; in phar_zip_flush()
1352 …zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeo… in phar_zip_flush()
1355 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1356 if (entry.fp == NULL) { in phar_zip_flush()
1360 if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { in phar_zip_flush()
1361 php_stream_close(entry.fp); in phar_zip_flush()
1368 entry.uncompressed_filesize = entry.compressed_filesize = sizeof(newstub) - 1; in phar_zip_flush()
1369 entry.filename = estrndup(".phar/stub.php", sizeof(".phar/stub.php")-1); in phar_zip_flush()
1370 entry.filename_len = sizeof(".phar/stub.php")-1; in phar_zip_flush()
1374 …if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&ent… in phar_zip_flush()
1375 php_stream_close(entry.fp); in phar_zip_flush()
1376 efree(entry.filename); in phar_zip_flush()
1383 php_stream_close(entry.fp); in phar_zip_flush()
1384 efree(entry.filename); in phar_zip_flush()
1387 …zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeo… in phar_zip_flush()