Lines Matching refs:entry
53 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
74 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
83 if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) { in ZEND_INI_MH()
338 phar_entry_info *entry = (phar_entry_info *) Z_PTR_P(zv); in phar_tmpclose_apply() local
340 if (entry->fp_type != PHAR_TMP) { in phar_tmpclose_apply()
344 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
345 php_stream_close(entry->fp); in phar_tmpclose_apply()
346 entry->fp = NULL; in phar_tmpclose_apply()
379 void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */ in destroy_phar_manifest_entry_int() argument
382 if (entry->cfp) { in destroy_phar_manifest_entry_int()
383 php_stream_close(entry->cfp); in destroy_phar_manifest_entry_int()
384 entry->cfp = 0; in destroy_phar_manifest_entry_int()
387 if (entry->fp) { in destroy_phar_manifest_entry_int()
388 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
389 entry->fp = 0; in destroy_phar_manifest_entry_int()
392 if (Z_TYPE(entry->metadata) != IS_UNDEF) { in destroy_phar_manifest_entry_int()
393 if (entry->is_persistent) { in destroy_phar_manifest_entry_int()
394 if (entry->metadata_len) { in destroy_phar_manifest_entry_int()
396 free(Z_PTR(entry->metadata)); in destroy_phar_manifest_entry_int()
398 zval_internal_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry_int()
401 zval_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry_int()
403 entry->metadata_len = 0; in destroy_phar_manifest_entry_int()
404 ZVAL_UNDEF(&entry->metadata); in destroy_phar_manifest_entry_int()
407 if (entry->metadata_str.s) { in destroy_phar_manifest_entry_int()
408 smart_str_free(&entry->metadata_str); in destroy_phar_manifest_entry_int()
409 entry->metadata_str.s = NULL; in destroy_phar_manifest_entry_int()
412 pefree(entry->filename, entry->is_persistent); in destroy_phar_manifest_entry_int()
414 if (entry->link) { in destroy_phar_manifest_entry_int()
415 pefree(entry->link, entry->is_persistent); in destroy_phar_manifest_entry_int()
416 entry->link = 0; in destroy_phar_manifest_entry_int()
419 if (entry->tmp) { in destroy_phar_manifest_entry_int()
420 pefree(entry->tmp, entry->is_persistent); in destroy_phar_manifest_entry_int()
421 entry->tmp = 0; in destroy_phar_manifest_entry_int()
428 phar_entry_info *entry = Z_PTR_P(zv); in destroy_phar_manifest_entry() local
429 destroy_phar_manifest_entry_int(entry); in destroy_phar_manifest_entry()
430 pefree(entry, entry->is_persistent); in destroy_phar_manifest_entry()
670 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);
1188 …zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof…
2195 …onst char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, i… argument
2248 *entry = estrndup(ext_str+ext_len, *entry_len);
2250 phar_unixify_path_separators(*entry, *entry_len);
2252 *entry = phar_fix_filepath(*entry, entry_len, 0);
2255 *entry = estrndup("/", 1);
2342 phar_entry_info *entry = idata->internal_file; local
2348 if (entry->is_zip && process_zip > 0) {
2354 … archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename);
2357 php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET);
2361 …phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename);
2368 entry->header_offset + sizeof(local) +
2371 entry->compressed_filesize, SEEK_SET);
2374 … \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename);
2385 …entry->filename_len != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32)…
2386 …cal header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename);
2391 entry->offset = entry->offset_abs =
2392 …sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_l…
2394 if (idata->zero && idata->zero != entry->offset_abs) {
2395 idata->zero = entry->offset_abs;
2412 entry->is_crc_checked = 1;
2415 …l corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename);
2435 phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); local
2437 if (entry->fp_refcount <= 0 && entry->is_deleted) {
2497 phar_entry_info *entry, *newentry; local
2687 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
2690 if (entry->cfp) {
2692 php_stream_close(entry->cfp);
2693 entry->cfp = 0;
2695 if (entry->is_deleted || entry->is_mounted) {
2699 if (!entry->is_modified && entry->fp_refcount) {
2701 switch (entry->fp_type) {
2713 phar_add_virtual_dirs(phar, entry->filename, entry->filename_len);
2715 if (entry->is_dir) {
2719 if (Z_TYPE(entry->metadata) != IS_UNDEF) {
2720 if (entry->metadata_str.s) {
2721 smart_str_free(&entry->metadata_str);
2723 entry->metadata_str.s = NULL;
2725 php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash);
2728 if (entry->metadata_str.s) {
2729 smart_str_free(&entry->metadata_str);
2731 entry->metadata_str.s = NULL;
2735 …offset += 4 + entry->filename_len + sizeof(entry_buffer) + (entry->metadata_str.s ? ZSTR_LEN(entry…
2738 if ((oldfile && !entry->is_modified) || entry->is_dir) {
2739 if (entry->fp_type == PHAR_UFP) {
2741 entry->fp_type = PHAR_FP;
2745 if (!phar_get_efp(entry, 0)) {
2747 newentry = phar_open_jit(phar, entry, error);
2754 entry = newentry;
2756 file = phar_get_efp(entry, 0);
2757 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) {
2763 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2768 mytime = entry->uncompressed_filesize;
2772 entry->crc32 = ~newcrc32;
2773 entry->is_crc_checked = 1;
2774 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) {
2776 entry->compressed_filesize = entry->uncompressed_filesize;
2779 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0);
2785 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
2787 …spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar…
2791 …spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, pha…
2800 entry->cfp = php_stream_fopen_tmpfile();
2801 if (!entry->cfp) {
2812 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
2818 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2822 php_stream_filter_append((&entry->cfp->writefilters), filter);
2823 …if (SUCCESS != php_stream_copy_to_stream_ex(file, entry->cfp, entry->uncompressed_filesize, NULL))…
2829 … compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2834 php_stream_flush(entry->cfp);
2836 php_stream_seek(entry->cfp, 0, SEEK_END);
2837 entry->compressed_filesize = (uint32_t) php_stream_tell(entry->cfp);
2839 php_stream_rewind(entry->cfp);
2840 entry->old_flags = entry->flags;
2841 entry->is_modified = 1;
2842 global_flags |= (entry->flags & PHAR_ENT_COMPRESSION_MASK);
2928 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
2932 if (entry->is_deleted || entry->is_mounted) {
2937 if (entry->is_dir) {
2939 phar_set_32(entry_buffer, entry->filename_len + 1);
2941 phar_set_32(entry_buffer, entry->filename_len);
2945 || entry->filename_len != php_stream_write(newfile, entry->filename, entry->filename_len)
2946 || (entry->is_dir && 1 != php_stream_write(newfile, "/", 1))) {
2952 if (entry->is_dir) {
2953 …le to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
2955 …"unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
2971 phar_set_32(entry_buffer, entry->uncompressed_filesize);
2973 phar_set_32(entry_buffer+8, entry->compressed_filesize);
2974 phar_set_32(entry_buffer+12, entry->crc32);
2975 phar_set_32(entry_buffer+16, entry->flags);
2976 phar_set_32(entry_buffer+20, entry->metadata_str.s ? ZSTR_LEN(entry->metadata_str.s) : 0);
2979 || (entry->metadata_str.s &&
2980 …ZSTR_LEN(entry->metadata_str.s) != php_stream_write(newfile, ZSTR_VAL(entry->metadata_str.s), ZSTR…
2988 … write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
3017 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
3021 if (entry->is_deleted || entry->is_dir || entry->is_mounted) {
3025 if (entry->cfp) {
3026 file = entry->cfp;
3029 file = phar_get_efp(entry, 0);
3030 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
3036 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3048 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3054 entry->offset = entry->offset_abs = offset;
3055 offset += entry->compressed_filesize;
3056 if (php_stream_copy_to_stream_ex(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) {
3064 …spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, …
3070 entry->is_modified = 0;
3072 if (entry->cfp) {
3073 php_stream_close(entry->cfp);
3074 entry->cfp = NULL;
3077 if (entry->fp_type == PHAR_MOD) {
3079 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
3080 php_stream_close(entry->fp);
3083 entry->fp = NULL;
3084 entry->fp_type = PHAR_FP;
3085 } else if (entry->fp_type == PHAR_UFP) {
3086 entry->fp_type = PHAR_FP;
3110 …ite contents of file \"%s\" to new phar \"%s\" with requested hash type", entry->filename, phar->f…