Lines Matching refs:entry

42 static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, uint16_t len) /* {{{ */  in phar_zip_process_extra()  argument
76 entry->flags &= PHAR_ENT_COMPRESSION_MASK; in phar_zip_process_extra()
78 if (entry->is_dir) { in phar_zip_process_extra()
79 entry->flags |= PHAR_GET_16(h.unix3.perms) & PHAR_ENT_PERM_MASK; in phar_zip_process_extra()
81 entry->flags |= PHAR_GET_16(h.unix3.perms) & PHAR_ENT_PERM_MASK; in phar_zip_process_extra()
204 phar_entry_info entry = {0}; in phar_parse_zipfile() local
312 entry.phar = mydata; in phar_parse_zipfile()
313 entry.is_zip = 1; in phar_parse_zipfile()
314 entry.fp_type = PHAR_FP; in phar_parse_zipfile()
315 entry.is_persistent = mydata->is_persistent; in phar_parse_zipfile()
365 ZVAL_UNDEF(&entry.metadata_tracker.val); in phar_parse_zipfile()
366 entry.metadata_tracker.str = NULL; in phar_parse_zipfile()
378 if (entry.is_persistent) { in phar_parse_zipfile()
379 entry.manifest_pos = i; in phar_parse_zipfile()
382 entry.compressed_filesize = PHAR_GET_32(zipentry.compsize); in phar_parse_zipfile()
383 entry.uncompressed_filesize = PHAR_GET_32(zipentry.uncompsize); in phar_parse_zipfile()
384 entry.crc32 = PHAR_GET_32(zipentry.crc32); in phar_parse_zipfile()
386 entry.timestamp = phar_zip_d2u_time(zipentry.timestamp, zipentry.datestamp); in phar_parse_zipfile()
387 entry.flags = PHAR_ENT_PERM_DEF_FILE; in phar_parse_zipfile()
388 entry.header_offset = PHAR_GET_32(zipentry.offset); in phar_parse_zipfile()
398 entry.filename_len = PHAR_GET_16(zipentry.filename_len); in phar_parse_zipfile()
399 entry.filename = (char *) pemalloc(entry.filename_len + 1, entry.is_persistent); in phar_parse_zipfile()
401 if (entry.filename_len != php_stream_read(fp, entry.filename, entry.filename_len)) { in phar_parse_zipfile()
402 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
406 entry.filename[entry.filename_len] = '\0'; in phar_parse_zipfile()
408 if (entry.filename[entry.filename_len - 1] == '/') { in phar_parse_zipfile()
409 entry.is_dir = 1; in phar_parse_zipfile()
410 if(entry.filename_len > 1) { in phar_parse_zipfile()
411 entry.filename_len--; in phar_parse_zipfile()
413 entry.flags |= PHAR_ENT_PERM_DEF_DIR; in phar_parse_zipfile()
415 entry.is_dir = 0; in phar_parse_zipfile()
419 if (!entry.is_dir) { in phar_parse_zipfile()
427 php_stream_seek(fp, entry.header_offset, SEEK_SET); in phar_parse_zipfile()
429 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
438 if (entry.filename_len != PHAR_GET_16(local.filename_len)) { in phar_parse_zipfile()
439 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
443 entry.offset = entry.offset_abs = entry.header_offset in phar_parse_zipfile()
445 + entry.filename_len in phar_parse_zipfile()
448 entry.offset = entry.offset_abs = entry.header_offset in phar_parse_zipfile()
450 + entry.filename_len in phar_parse_zipfile()
454 …if (entry.filename_len == sizeof(".phar/signature.bin")-1 && !strncmp(entry.filename, ".phar/signa… in phar_parse_zipfile()
460 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
462 if (entry.uncompressed_filesize > 0x10000) { in phar_parse_zipfile()
473 php_stream_copy_to_stream_ex(fp, sigfile, entry.header_offset, NULL); in phar_parse_zipfile()
481 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
482 sig = (char *) emalloc(entry.uncompressed_filesize); in phar_parse_zipfile()
483 read = php_stream_read(fp, sig, entry.uncompressed_filesize); in phar_parse_zipfile()
484 if (read != entry.uncompressed_filesize || read <= 8) { in phar_parse_zipfile()
490 …_signature(sigfile, php_stream_tell(sigfile), mydata->sig_flags, sig + 8, entry.uncompressed_files… in phar_parse_zipfile()
514 phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len); in phar_parse_zipfile()
518 if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len))) { in phar_parse_zipfile()
519 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
530 entry.flags |= PHAR_ENT_COMPRESSED_GZ; in phar_parse_zipfile()
532 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
537 entry.flags |= PHAR_ENT_COMPRESSED_BZ2; in phar_parse_zipfile()
539 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
544 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
550 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
553 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
556 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
559 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
562 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
565 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
568 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
571 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
574 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
577 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
580 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
587 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
592 …phar_parse_metadata_lazy(buf, &entry.metadata_tracker, PHAR_GET_16(zipentry.comment_len), entry.is… in phar_parse_zipfile()
594 ZVAL_UNDEF(&entry.metadata_tracker.val); in phar_parse_zipfile()
597 …if (!actual_alias && entry.filename_len == sizeof(".phar/alias.txt")-1 && !strncmp(entry.filename,… in phar_parse_zipfile()
603 ZEND_ASSERT(!entry.is_dir); in phar_parse_zipfile()
604 …if (entry.crc32 != PHAR_GET_32(local.crc32) || entry.uncompressed_filesize != PHAR_GET_32(local.un… in phar_parse_zipfile()
605 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
610 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
614 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
619 mydata->alias_len = entry.uncompressed_filesize; in phar_parse_zipfile()
620 if (entry.flags & PHAR_ENT_COMPRESSED_GZ) { in phar_parse_zipfile()
624 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
633 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
635 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
640 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
644 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
645 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
652 } else if (entry.flags & PHAR_ENT_COMPRESSED_BZ2) { 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()
687 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
689 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
694 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
698 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
699 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
708 phar_set_inode(&entry); in phar_parse_zipfile()
709 …zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void *)&entry, sizeo… in phar_parse_zipfile()
752 …mydata->alias = entry.is_persistent ? pestrndup(actual_alias, mydata->alias_len, 1) : actual_alias; in phar_parse_zipfile()
754 if (entry.is_persistent) { in phar_parse_zipfile()
839 static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ */ in phar_zip_changed_apply_int() argument
851 if (entry->is_mounted) { in phar_zip_changed_apply_int()
855 if (entry->is_deleted) { in phar_zip_changed_apply_int()
856 if (entry->fp_refcount <= 0) { in phar_zip_changed_apply_int()
864 phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len); in phar_zip_changed_apply_int()
875 PHAR_SET_16(perms.perms, entry->flags & PHAR_ENT_PERM_MASK); in phar_zip_changed_apply_int()
883 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_zip_changed_apply_int()
888 if (entry->flags & PHAR_ENT_COMPRESSED_BZ2) { in phar_zip_changed_apply_int()
894 phar_zip_u2d_time(entry->timestamp, local.timestamp, local.datestamp); in phar_zip_changed_apply_int()
897 PHAR_SET_16(central.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); in phar_zip_changed_apply_int()
898 PHAR_SET_16(local.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); in phar_zip_changed_apply_int()
907 if (entry->is_modified) { in phar_zip_changed_apply_int()
911 if (entry->is_dir) { in phar_zip_changed_apply_int()
912 entry->is_modified = 0; in phar_zip_changed_apply_int()
913 … if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) { in phar_zip_changed_apply_int()
914 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
915 entry->fp = NULL; in phar_zip_changed_apply_int()
916 entry->fp_type = PHAR_FP; in phar_zip_changed_apply_int()
921 if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { in phar_zip_changed_apply_int()
922 … to open file contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
927 …if (entry->flags & PHAR_ENT_COMPRESSION_MASK && (entry->old_flags == entry->flags || !entry->old_f… in phar_zip_changed_apply_int()
932 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_zip_changed_apply_int()
933 …nable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
937 efp = phar_get_efp(entry, 0); in phar_zip_changed_apply_int()
940 php_crc32_stream_bulk_update(&newcrc32, efp, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
942 entry->crc32 = php_crc32_bulk_end(newcrc32); in phar_zip_changed_apply_int()
943 PHAR_SET_32(central.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
944 PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
946 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) { in phar_zip_changed_apply_int()
948 entry->compressed_filesize = entry->uncompressed_filesize; in phar_zip_changed_apply_int()
949 PHAR_SET_32(central.compsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
950 PHAR_SET_32(local.compsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
954 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); in phar_zip_changed_apply_int()
957 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_zip_changed_apply_int()
958 … "unable to gzip compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
960 …"unable to bzip2 compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
968 entry->cfp = php_stream_fopen_tmpfile(); in phar_zip_changed_apply_int()
970 if (!entry->cfp) { in phar_zip_changed_apply_int()
971 …rary file for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
977 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_zip_changed_apply_int()
978 …nable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
982 php_stream_filter_append((&entry->cfp->writefilters), filter); in phar_zip_changed_apply_int()
984 …if (SUCCESS != php_stream_copy_to_stream_ex(efp, entry->cfp, entry->uncompressed_filesize, NULL)) { in phar_zip_changed_apply_int()
985 …ed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
990 php_stream_flush(entry->cfp); in phar_zip_changed_apply_int()
992 php_stream_seek(entry->cfp, 0, SEEK_END); in phar_zip_changed_apply_int()
993 entry->compressed_filesize = (uint32_t) php_stream_tell(entry->cfp); in phar_zip_changed_apply_int()
994 PHAR_SET_32(central.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
995 PHAR_SET_32(local.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
997 php_stream_rewind(entry->cfp); in phar_zip_changed_apply_int()
998 entry->old_flags = entry->flags; in phar_zip_changed_apply_int()
999 entry->is_modified = 1; in phar_zip_changed_apply_int()
1002 PHAR_SET_32(central.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
1003 PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
1004 PHAR_SET_32(central.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
1005 PHAR_SET_32(local.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
1007 if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) { in phar_zip_changed_apply_int()
1008 …k to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1014 PHAR_SET_32(central.crc32, entry->crc32); in phar_zip_changed_apply_int()
1015 PHAR_SET_32(local.crc32, entry->crc32); in phar_zip_changed_apply_int()
1018 if (phar_metadata_tracker_has_data(&entry->metadata_tracker, entry->is_persistent)) { in phar_zip_changed_apply_int()
1019 …phar_metadata_tracker_try_ensure_has_serialized_data(&entry->metadata_tracker, entry->is_persisten… in phar_zip_changed_apply_int()
1020 …PHAR_SET_16(central.comment_len, entry->metadata_tracker.str ? ZSTR_LEN(entry->metadata_tracker.st… in phar_zip_changed_apply_int()
1023 entry->header_offset = php_stream_tell(p->filefp); in phar_zip_changed_apply_int()
1024 …offset = entry->header_offset + sizeof(local) + entry->filename_len + (entry->is_dir ? 1 : 0) + si… in phar_zip_changed_apply_int()
1027 …rite local file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1032 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1036 if (entry->is_dir) { in phar_zip_changed_apply_int()
1037 if (entry->filename_len != php_stream_write(p->filefp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1038 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1043 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1047 if (entry->filename_len != php_stream_write(p->centralfp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1048 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1053 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1057 if (entry->filename_len != php_stream_write(p->filefp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1058 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1062 if (entry->filename_len != php_stream_write(p->centralfp, entry->filename, entry->filename_len)) { 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()
1069 …ermissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1074 …ermissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1078 if (!not_really_modified && entry->is_modified) { in phar_zip_changed_apply_int()
1079 if (entry->cfp) { in phar_zip_changed_apply_int()
1080 …if (SUCCESS != php_stream_copy_to_stream_ex(entry->cfp, p->filefp, entry->compressed_filesize, NUL… in phar_zip_changed_apply_int()
1081 …te compressed contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1085 php_stream_close(entry->cfp); in phar_zip_changed_apply_int()
1086 entry->cfp = NULL; in phar_zip_changed_apply_int()
1088 if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { in phar_zip_changed_apply_int()
1092 phar_seek_efp(entry, 0, SEEK_SET, 0, 0); in phar_zip_changed_apply_int()
1094 …if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), p->filefp, entry->uncompressed… in phar_zip_changed_apply_int()
1095 …able to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1100 …if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp &&… in phar_zip_changed_apply_int()
1101 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
1104 entry->is_modified = 0; in phar_zip_changed_apply_int()
1106 entry->is_modified = 0; in phar_zip_changed_apply_int()
1107 if (entry->fp_refcount) { in phar_zip_changed_apply_int()
1109 switch (entry->fp_type) { in phar_zip_changed_apply_int()
1120 …if (!entry->is_dir && entry->compressed_filesize && SUCCESS != php_stream_copy_to_stream_ex(p->old… in phar_zip_changed_apply_int()
1121 …y contents of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1126 entry->fp = NULL; in phar_zip_changed_apply_int()
1127 entry->offset = entry->offset_abs = offset; in phar_zip_changed_apply_int()
1128 entry->fp_type = PHAR_FP; in phar_zip_changed_apply_int()
1130 if (entry->metadata_tracker.str) { in phar_zip_changed_apply_int()
1131 …if (ZSTR_LEN(entry->metadata_tracker.str) != php_stream_write(p->centralfp, ZSTR_VAL(entry->metada… in phar_zip_changed_apply_int()
1132 …e comment for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1153 phar_entry_info entry = {0}; in phar_zip_applysignature() local
1184 entry.filename = ".phar/signature.bin"; in phar_zip_applysignature()
1185 entry.filename_len = sizeof(".phar/signature.bin")-1; in phar_zip_applysignature()
1186 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_applysignature()
1187 entry.fp_type = PHAR_MOD; in phar_zip_applysignature()
1188 entry.is_modified = 1; in phar_zip_applysignature()
1189 if (entry.fp == NULL) { in phar_zip_applysignature()
1197 …if (Z_UL(8) != php_stream_write(entry.fp, sigbuf, 8) || signature_length != php_stream_write(entry in phar_zip_applysignature()
1208 entry.uncompressed_filesize = entry.compressed_filesize = signature_length + 8; in phar_zip_applysignature()
1209 entry.phar = phar; in phar_zip_applysignature()
1211 phar_zip_changed_apply_int(&entry, (void *)pass); in phar_zip_applysignature()
1231 phar_entry_info entry = {0}; in phar_zip_flush() local
1238 entry.flags = PHAR_ENT_PERM_DEF_FILE; in phar_zip_flush()
1239 entry.timestamp = time(NULL); in phar_zip_flush()
1240 entry.is_modified = 1; in phar_zip_flush()
1241 entry.is_zip = 1; in phar_zip_flush()
1242 entry.phar = phar; in phar_zip_flush()
1243 entry.fp_type = PHAR_MOD; in phar_zip_flush()
1258 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1259 if (entry.fp == NULL) { in phar_zip_flush()
1263 if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) { in phar_zip_flush()
1270 entry.uncompressed_filesize = entry.compressed_filesize = phar->alias_len; in phar_zip_flush()
1271 entry.filename = estrndup(".phar/alias.txt", sizeof(".phar/alias.txt")-1); in phar_zip_flush()
1272 entry.filename_len = sizeof(".phar/alias.txt")-1; in phar_zip_flush()
1274 …zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeo… in phar_zip_flush()
1341 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1342 if (entry.fp == NULL) { in phar_zip_flush()
1346 entry.uncompressed_filesize = len + 5; in phar_zip_flush()
1348 if ((size_t)len != php_stream_write(entry.fp, user_stub, len) in phar_zip_flush()
1349 || 5 != php_stream_write(entry.fp, " ?>\r\n", 5)) { in phar_zip_flush()
1356 php_stream_close(entry.fp); in phar_zip_flush()
1360 entry.filename = estrndup(".phar/stub.php", sizeof(".phar/stub.php")-1); in phar_zip_flush()
1361 entry.filename_len = sizeof(".phar/stub.php")-1; in phar_zip_flush()
1363 …zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeo… in phar_zip_flush()
1370 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1371 if (entry.fp == NULL) { in phar_zip_flush()
1375 if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { in phar_zip_flush()
1376 php_stream_close(entry.fp); in phar_zip_flush()
1383 entry.uncompressed_filesize = entry.compressed_filesize = sizeof(newstub) - 1; in phar_zip_flush()
1384 entry.filename = estrndup(".phar/stub.php", sizeof(".phar/stub.php")-1); in phar_zip_flush()
1385 entry.filename_len = sizeof(".phar/stub.php")-1; in phar_zip_flush()
1389 …if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&ent… in phar_zip_flush()
1390 php_stream_close(entry.fp); in phar_zip_flush()
1391 efree(entry.filename); in phar_zip_flush()
1398 php_stream_close(entry.fp); in phar_zip_flush()
1399 efree(entry.filename); in phar_zip_flush()
1402 …zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeo… in phar_zip_flush()