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…
2194 …onst char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, i… argument
2247 *entry = estrndup(ext_str+ext_len, *entry_len);
2249 phar_unixify_path_separators(*entry, *entry_len);
2251 *entry = phar_fix_filepath(*entry, entry_len, 0);
2254 *entry = estrndup("/", 1);
2341 phar_entry_info *entry = idata->internal_file; local
2347 if (entry->is_zip && process_zip > 0) {
2353 … archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename);
2356 php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET);
2360 …phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename);
2367 entry->header_offset + sizeof(local) +
2370 entry->compressed_filesize, SEEK_SET);
2373 … \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename);
2384 …entry->filename_len != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32)…
2385 …cal header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename);
2390 entry->offset = entry->offset_abs =
2391 …sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_l…
2393 if (idata->zero && idata->zero != entry->offset_abs) {
2394 idata->zero = entry->offset_abs;
2411 entry->is_crc_checked = 1;
2414 …l corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename);
2434 phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); local
2436 if (entry->fp_refcount <= 0 && entry->is_deleted) {
2496 phar_entry_info *entry, *newentry; local
2686 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
2689 if (entry->cfp) {
2691 php_stream_close(entry->cfp);
2692 entry->cfp = 0;
2694 if (entry->is_deleted || entry->is_mounted) {
2698 if (!entry->is_modified && entry->fp_refcount) {
2700 switch (entry->fp_type) {
2712 phar_add_virtual_dirs(phar, entry->filename, entry->filename_len);
2714 if (entry->is_dir) {
2718 if (Z_TYPE(entry->metadata) != IS_UNDEF) {
2719 if (entry->metadata_str.s) {
2720 smart_str_free(&entry->metadata_str);
2722 entry->metadata_str.s = NULL;
2724 php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash);
2727 if (entry->metadata_str.s) {
2728 smart_str_free(&entry->metadata_str);
2730 entry->metadata_str.s = NULL;
2734 …offset += 4 + entry->filename_len + sizeof(entry_buffer) + (entry->metadata_str.s ? ZSTR_LEN(entry…
2737 if ((oldfile && !entry->is_modified) || entry->is_dir) {
2738 if (entry->fp_type == PHAR_UFP) {
2740 entry->fp_type = PHAR_FP;
2744 if (!phar_get_efp(entry, 0)) {
2746 newentry = phar_open_jit(phar, entry, error);
2753 entry = newentry;
2755 file = phar_get_efp(entry, 0);
2756 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) {
2762 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2767 mytime = entry->uncompressed_filesize;
2771 entry->crc32 = ~newcrc32;
2772 entry->is_crc_checked = 1;
2773 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) {
2775 entry->compressed_filesize = entry->uncompressed_filesize;
2778 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0);
2784 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
2786 …spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar…
2790 …spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, pha…
2799 entry->cfp = php_stream_fopen_tmpfile();
2800 if (!entry->cfp) {
2811 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
2817 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2821 php_stream_filter_append((&entry->cfp->writefilters), filter);
2822 …if (SUCCESS != php_stream_copy_to_stream_ex(file, entry->cfp, entry->uncompressed_filesize, NULL))…
2828 … compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2833 php_stream_flush(entry->cfp);
2835 php_stream_seek(entry->cfp, 0, SEEK_END);
2836 entry->compressed_filesize = (uint32_t) php_stream_tell(entry->cfp);
2838 php_stream_rewind(entry->cfp);
2839 entry->old_flags = entry->flags;
2840 entry->is_modified = 1;
2841 global_flags |= (entry->flags & PHAR_ENT_COMPRESSION_MASK);
2927 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
2931 if (entry->is_deleted || entry->is_mounted) {
2936 if (entry->is_dir) {
2938 phar_set_32(entry_buffer, entry->filename_len + 1);
2940 phar_set_32(entry_buffer, entry->filename_len);
2944 || entry->filename_len != php_stream_write(newfile, entry->filename, entry->filename_len)
2945 || (entry->is_dir && 1 != php_stream_write(newfile, "/", 1))) {
2951 if (entry->is_dir) {
2952 …le to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
2954 …"unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
2970 phar_set_32(entry_buffer, entry->uncompressed_filesize);
2972 phar_set_32(entry_buffer+8, entry->compressed_filesize);
2973 phar_set_32(entry_buffer+12, entry->crc32);
2974 phar_set_32(entry_buffer+16, entry->flags);
2975 phar_set_32(entry_buffer+20, entry->metadata_str.s ? ZSTR_LEN(entry->metadata_str.s) : 0);
2978 || (entry->metadata_str.s &&
2979 …ZSTR_LEN(entry->metadata_str.s) != php_stream_write(newfile, ZSTR_VAL(entry->metadata_str.s), ZSTR…
2987 … write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
3016 if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
3020 if (entry->is_deleted || entry->is_dir || entry->is_mounted) {
3024 if (entry->cfp) {
3025 file = entry->cfp;
3028 file = phar_get_efp(entry, 0);
3029 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
3035 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3047 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3053 entry->offset = entry->offset_abs = offset;
3054 offset += entry->compressed_filesize;
3055 if (php_stream_copy_to_stream_ex(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) {
3063 …spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, …
3069 entry->is_modified = 0;
3071 if (entry->cfp) {
3072 php_stream_close(entry->cfp);
3073 entry->cfp = NULL;
3076 if (entry->fp_type == PHAR_MOD) {
3078 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
3079 php_stream_close(entry->fp);
3082 entry->fp = NULL;
3083 entry->fp_type = PHAR_FP;
3084 } else if (entry->fp_type == PHAR_UFP) {
3085 entry->fp_type = PHAR_FP;
3109 …ite contents of file \"%s\" to new phar \"%s\" with requested hash type", entry->filename, phar->f…