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()
173 phar_entry_info entry = {0}; in phar_parse_zipfile() local
290 entry.phar = mydata; in phar_parse_zipfile()
291 entry.is_zip = 1; in phar_parse_zipfile()
292 entry.fp_type = PHAR_FP; in phar_parse_zipfile()
293 entry.is_persistent = mydata->is_persistent; in phar_parse_zipfile()
353 if (entry.is_persistent) { in phar_parse_zipfile()
354 entry.manifest_pos = i; in phar_parse_zipfile()
357 entry.compressed_filesize = PHAR_GET_32(zipentry.compsize); in phar_parse_zipfile()
358 entry.uncompressed_filesize = PHAR_GET_32(zipentry.uncompsize); in phar_parse_zipfile()
359 entry.crc32 = PHAR_GET_32(zipentry.crc32); in phar_parse_zipfile()
361 entry.timestamp = phar_zip_d2u_time(zipentry.timestamp, zipentry.datestamp); in phar_parse_zipfile()
362 entry.flags = PHAR_ENT_PERM_DEF_FILE; in phar_parse_zipfile()
363 entry.header_offset = PHAR_GET_32(zipentry.offset); in phar_parse_zipfile()
364 …entry.offset = entry.offset_abs = PHAR_GET_32(zipentry.offset) + sizeof(phar_zip_file_header) + PH… in phar_parse_zipfile()
375 entry.filename_len = PHAR_GET_16(zipentry.filename_len); in phar_parse_zipfile()
376 entry.filename = (char *) pemalloc(entry.filename_len + 1, entry.is_persistent); in phar_parse_zipfile()
378 if (entry.filename_len != php_stream_read(fp, entry.filename, entry.filename_len)) { in phar_parse_zipfile()
379 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
383 entry.filename[entry.filename_len] = '\0'; in phar_parse_zipfile()
385 if (entry.filename[entry.filename_len - 1] == '/') { in phar_parse_zipfile()
386 entry.is_dir = 1; in phar_parse_zipfile()
387 if(entry.filename_len > 1) { in phar_parse_zipfile()
388 entry.filename_len--; in phar_parse_zipfile()
390 entry.flags |= PHAR_ENT_PERM_DEF_DIR; in phar_parse_zipfile()
392 entry.is_dir = 0; in phar_parse_zipfile()
395 …if (entry.filename_len == sizeof(".phar/signature.bin")-1 && !strncmp(entry.filename, ".phar/signa… in phar_parse_zipfile()
401 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
409 php_stream_copy_to_stream_ex(fp, sigfile, entry.header_offset, NULL); in phar_parse_zipfile()
417 …php_stream_seek(fp, sizeof(phar_zip_file_header) + entry.header_offset + entry.filename_len + PHAR… in phar_parse_zipfile()
418 sig = (char *) emalloc(entry.uncompressed_filesize); in phar_parse_zipfile()
419 read = php_stream_read(fp, sig, entry.uncompressed_filesize); in phar_parse_zipfile()
420 if (read != entry.uncompressed_filesize || read <= 8) { in phar_parse_zipfile()
426 …_signature(sigfile, php_stream_tell(sigfile), mydata->sig_flags, sig + 8, entry.uncompressed_files… in phar_parse_zipfile()
449 phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len); in phar_parse_zipfile()
453 if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len))) { in phar_parse_zipfile()
454 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
465 entry.flags |= PHAR_ENT_COMPRESSED_GZ; in phar_parse_zipfile()
467 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
472 entry.flags |= PHAR_ENT_COMPRESSED_BZ2; in phar_parse_zipfile()
474 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
479 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
485 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
488 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
491 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
494 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
497 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
500 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
503 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
506 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
509 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
512 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
515 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
522 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
527 entry.metadata_len = PHAR_GET_16(zipentry.comment_len); in phar_parse_zipfile()
529 if (phar_parse_metadata(&p, &(entry.metadata), PHAR_GET_16(zipentry.comment_len)) == FAILURE) { in phar_parse_zipfile()
530 entry.metadata_len = 0; in phar_parse_zipfile()
533 …ZVAL_NEW_STR(&entry.metadata, zend_string_init(buf, PHAR_GET_16(zipentry.comment_len), entry.is_pe… in phar_parse_zipfile()
536 ZVAL_UNDEF(&entry.metadata); in phar_parse_zipfile()
539 …if (!actual_alias && entry.filename_len == sizeof(".phar/alias.txt")-1 && !strncmp(entry.filename,… in phar_parse_zipfile()
550 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
555 …entry.filename_len != PHAR_GET_16(local.filename_len) || entry.crc32 != PHAR_GET_32(local.crc32) |… in phar_parse_zipfile()
556 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
561 entry.offset = entry.offset_abs = in phar_parse_zipfile()
562 …sizeof(local) + entry.header_offset + PHAR_GET_16(local.filename_len) + PHAR_GET_16(local.extra_le… in phar_parse_zipfile()
563 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
567 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
572 mydata->alias_len = entry.uncompressed_filesize; in phar_parse_zipfile()
573 if (entry.flags & PHAR_ENT_COMPRESSED_GZ) { in phar_parse_zipfile()
577 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
586 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
588 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
593 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
597 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
598 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
605 } else if (entry.flags & PHAR_ENT_COMPRESSED_BZ2) { in phar_parse_zipfile()
609 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
618 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
620 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
625 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
629 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
630 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
640 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
642 entry.uncompressed_filesize = ZSTR_LEN(str); in phar_parse_zipfile()
647 entry.uncompressed_filesize = 0; in phar_parse_zipfile()
651 if (!entry.uncompressed_filesize || !actual_alias) { in phar_parse_zipfile()
652 pefree(entry.filename, entry.is_persistent); in phar_parse_zipfile()
661 phar_set_inode(&entry); in phar_parse_zipfile()
662 …zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void *)&entry, sizeo… in phar_parse_zipfile()
700 …mydata->alias = entry.is_persistent ? pestrndup(actual_alias, mydata->alias_len, 1) : actual_alias; in phar_parse_zipfile()
702 if (entry.is_persistent) { in phar_parse_zipfile()
787 static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ */ in phar_zip_changed_apply_int() argument
798 if (entry->is_mounted) { in phar_zip_changed_apply_int()
802 if (entry->is_deleted) { in phar_zip_changed_apply_int()
803 if (entry->fp_refcount <= 0) { in phar_zip_changed_apply_int()
811 phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len); in phar_zip_changed_apply_int()
822 PHAR_SET_16(perms.perms, entry->flags & PHAR_ENT_PERM_MASK); in phar_zip_changed_apply_int()
830 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_zip_changed_apply_int()
835 if (entry->flags & PHAR_ENT_COMPRESSED_BZ2) { in phar_zip_changed_apply_int()
841 phar_zip_u2d_time(entry->timestamp, local.timestamp, local.datestamp); in phar_zip_changed_apply_int()
844 PHAR_SET_16(central.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); in phar_zip_changed_apply_int()
845 PHAR_SET_16(local.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); in phar_zip_changed_apply_int()
849 if (entry->is_modified) { in phar_zip_changed_apply_int()
854 if (entry->is_dir) { in phar_zip_changed_apply_int()
855 entry->is_modified = 0; in phar_zip_changed_apply_int()
856 … if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) { in phar_zip_changed_apply_int()
857 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
858 entry->fp = NULL; in phar_zip_changed_apply_int()
859 entry->fp_type = PHAR_FP; in phar_zip_changed_apply_int()
864 if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { in phar_zip_changed_apply_int()
865 … to open file contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
870 …if (entry->flags & PHAR_ENT_COMPRESSION_MASK && (entry->old_flags == entry->flags || !entry->old_f… in phar_zip_changed_apply_int()
875 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_zip_changed_apply_int()
876 …nable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
880 efp = phar_get_efp(entry, 0); in phar_zip_changed_apply_int()
883 for (loc = 0;loc < entry->uncompressed_filesize; ++loc) { in phar_zip_changed_apply_int()
887 entry->crc32 = ~newcrc32; in phar_zip_changed_apply_int()
888 PHAR_SET_32(central.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
889 PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
891 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) { in phar_zip_changed_apply_int()
893 entry->compressed_filesize = entry->uncompressed_filesize; in phar_zip_changed_apply_int()
894 PHAR_SET_32(central.compsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
895 PHAR_SET_32(local.compsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
899 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); in phar_zip_changed_apply_int()
902 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { in phar_zip_changed_apply_int()
903 … "unable to gzip compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
905 …"unable to bzip2 compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
913 entry->cfp = php_stream_fopen_tmpfile(); in phar_zip_changed_apply_int()
915 if (!entry->cfp) { in phar_zip_changed_apply_int()
916 …rary file for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
922 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { in phar_zip_changed_apply_int()
923 …nable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
927 php_stream_filter_append((&entry->cfp->writefilters), filter); in phar_zip_changed_apply_int()
929 …if (SUCCESS != php_stream_copy_to_stream_ex(efp, entry->cfp, entry->uncompressed_filesize, NULL)) { in phar_zip_changed_apply_int()
930 …ed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
935 php_stream_flush(entry->cfp); in phar_zip_changed_apply_int()
937 php_stream_seek(entry->cfp, 0, SEEK_END); in phar_zip_changed_apply_int()
938 entry->compressed_filesize = (uint32_t) php_stream_tell(entry->cfp); in phar_zip_changed_apply_int()
939 PHAR_SET_32(central.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
940 PHAR_SET_32(local.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
942 php_stream_rewind(entry->cfp); in phar_zip_changed_apply_int()
943 entry->old_flags = entry->flags; in phar_zip_changed_apply_int()
944 entry->is_modified = 1; in phar_zip_changed_apply_int()
947 PHAR_SET_32(central.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
948 PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); in phar_zip_changed_apply_int()
949 PHAR_SET_32(central.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
950 PHAR_SET_32(local.compsize, entry->compressed_filesize); in phar_zip_changed_apply_int()
952 if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) { in phar_zip_changed_apply_int()
953 …k to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
959 PHAR_SET_32(central.crc32, entry->crc32); in phar_zip_changed_apply_int()
960 PHAR_SET_32(local.crc32, entry->crc32); in phar_zip_changed_apply_int()
963 if (Z_TYPE(entry->metadata) != IS_UNDEF) { in phar_zip_changed_apply_int()
966 if (entry->metadata_str.s) { in phar_zip_changed_apply_int()
967 smart_str_free(&entry->metadata_str); in phar_zip_changed_apply_int()
969 entry->metadata_str.s = NULL; in phar_zip_changed_apply_int()
971 php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash); in phar_zip_changed_apply_int()
973 PHAR_SET_16(central.comment_len, ZSTR_LEN(entry->metadata_str.s)); in phar_zip_changed_apply_int()
976 entry->header_offset = php_stream_tell(p->filefp); in phar_zip_changed_apply_int()
977 …offset = entry->header_offset + sizeof(local) + entry->filename_len + (entry->is_dir ? 1 : 0) + si… in phar_zip_changed_apply_int()
980 …rite local file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
985 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
989 if (entry->is_dir) { in phar_zip_changed_apply_int()
990 if (entry->filename_len != php_stream_write(p->filefp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
991 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
996 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1000 if (entry->filename_len != php_stream_write(p->centralfp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1001 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1006 …ntry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1010 if (entry->filename_len != php_stream_write(p->filefp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1011 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1015 if (entry->filename_len != php_stream_write(p->centralfp, entry->filename, entry->filename_len)) { in phar_zip_changed_apply_int()
1016 …ory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1022 …ermissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1027 …ermissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1031 if (!not_really_modified && entry->is_modified) { in phar_zip_changed_apply_int()
1032 if (entry->cfp) { in phar_zip_changed_apply_int()
1033 …if (SUCCESS != php_stream_copy_to_stream_ex(entry->cfp, p->filefp, entry->compressed_filesize, NUL… in phar_zip_changed_apply_int()
1034 …te compressed contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1038 php_stream_close(entry->cfp); in phar_zip_changed_apply_int()
1039 entry->cfp = NULL; in phar_zip_changed_apply_int()
1041 if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { in phar_zip_changed_apply_int()
1045 phar_seek_efp(entry, 0, SEEK_SET, 0, 0); in phar_zip_changed_apply_int()
1047 …if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), p->filefp, entry->uncompressed… in phar_zip_changed_apply_int()
1048 …able to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1053 …if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp &&… in phar_zip_changed_apply_int()
1054 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
1057 entry->is_modified = 0; in phar_zip_changed_apply_int()
1059 entry->is_modified = 0; in phar_zip_changed_apply_int()
1060 if (entry->fp_refcount) { in phar_zip_changed_apply_int()
1062 switch (entry->fp_type) { in phar_zip_changed_apply_int()
1073 …if (!entry->is_dir && entry->compressed_filesize && SUCCESS != php_stream_copy_to_stream_ex(p->old… in phar_zip_changed_apply_int()
1074 …y contents of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1079 entry->fp = NULL; in phar_zip_changed_apply_int()
1080 entry->offset = entry->offset_abs = offset; in phar_zip_changed_apply_int()
1081 entry->fp_type = PHAR_FP; in phar_zip_changed_apply_int()
1083 if (entry->metadata_str.s) { in phar_zip_changed_apply_int()
1084 …if (ZSTR_LEN(entry->metadata_str.s) != php_stream_write(p->centralfp, ZSTR_VAL(entry->metadata_str… in phar_zip_changed_apply_int()
1085 …e comment for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fna… in phar_zip_changed_apply_int()
1086 smart_str_free(&entry->metadata_str); in phar_zip_changed_apply_int()
1090 smart_str_free(&entry->metadata_str); in phar_zip_changed_apply_int()
1110 phar_entry_info entry = {0}; in phar_zip_applysignature() local
1141 entry.filename = ".phar/signature.bin"; in phar_zip_applysignature()
1142 entry.filename_len = sizeof(".phar/signature.bin")-1; in phar_zip_applysignature()
1143 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_applysignature()
1144 entry.fp_type = PHAR_MOD; in phar_zip_applysignature()
1145 entry.is_modified = 1; in phar_zip_applysignature()
1146 if (entry.fp == NULL) { in phar_zip_applysignature()
1154 …if (8 != (int)php_stream_write(entry.fp, sigbuf, 8) || signature_length != (int)php_stream_write(e… in phar_zip_applysignature()
1165 entry.uncompressed_filesize = entry.compressed_filesize = signature_length + 8; in phar_zip_applysignature()
1166 entry.phar = phar; in phar_zip_applysignature()
1168 phar_zip_changed_apply_int(&entry, (void *)pass); in phar_zip_applysignature()
1191 phar_entry_info entry = {0}; in phar_zip_flush() local
1198 entry.flags = PHAR_ENT_PERM_DEF_FILE; in phar_zip_flush()
1199 entry.timestamp = time(NULL); in phar_zip_flush()
1200 entry.is_modified = 1; in phar_zip_flush()
1201 entry.is_zip = 1; in phar_zip_flush()
1202 entry.phar = phar; in phar_zip_flush()
1203 entry.fp_type = PHAR_MOD; in phar_zip_flush()
1218 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1219 if (entry.fp == NULL) { in phar_zip_flush()
1223 if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { in phar_zip_flush()
1230 entry.uncompressed_filesize = entry.compressed_filesize = phar->alias_len; in phar_zip_flush()
1231 entry.filename = estrndup(".phar/alias.txt", sizeof(".phar/alias.txt")-1); in phar_zip_flush()
1232 entry.filename_len = sizeof(".phar/alias.txt")-1; in phar_zip_flush()
1234 … (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&en… in phar_zip_flush()
1310 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1311 if (entry.fp == NULL) { in phar_zip_flush()
1315 entry.uncompressed_filesize = len + 5; in phar_zip_flush()
1317 if ((size_t)len != php_stream_write(entry.fp, user_stub, len) in phar_zip_flush()
1318 || 5 != php_stream_write(entry.fp, " ?>\r\n", 5)) { in phar_zip_flush()
1325 php_stream_close(entry.fp); in phar_zip_flush()
1329 entry.filename = estrndup(".phar/stub.php", sizeof(".phar/stub.php")-1); in phar_zip_flush()
1330 entry.filename_len = sizeof(".phar/stub.php")-1; in phar_zip_flush()
1332 … (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&en… in phar_zip_flush()
1347 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1348 if (entry.fp == NULL) { in phar_zip_flush()
1352 if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { in phar_zip_flush()
1353 php_stream_close(entry.fp); in phar_zip_flush()
1360 entry.uncompressed_filesize = entry.compressed_filesize = sizeof(newstub) - 1; in phar_zip_flush()
1361 entry.filename = estrndup(".phar/stub.php", sizeof(".phar/stub.php")-1); in phar_zip_flush()
1362 entry.filename_len = sizeof(".phar/stub.php")-1; in phar_zip_flush()
1366 …if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&ent… in phar_zip_flush()
1367 php_stream_close(entry.fp); in phar_zip_flush()
1368 efree(entry.filename); in phar_zip_flush()
1375 php_stream_close(entry.fp); in phar_zip_flush()
1376 efree(entry.filename); in phar_zip_flush()
1379 … (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&en… in phar_zip_flush()
1380 php_stream_close(entry.fp); in phar_zip_flush()
1381 efree(entry.filename); in phar_zip_flush()