Lines Matching refs:entry
53 if (entry->name_length == 14) { in ZEND_INI_MH()
74 if (entry->name_length == 14) { in ZEND_INI_MH()
83 if (entry->name_length == 14) { in ZEND_INI_MH()
338 phar_entry_info *entry = (phar_entry_info *) pDest; 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()
382 phar_entry_info *entry = (phar_entry_info *)pDest; in destroy_phar_manifest_entry() local
385 if (entry->cfp) { in destroy_phar_manifest_entry()
386 php_stream_close(entry->cfp); in destroy_phar_manifest_entry()
387 entry->cfp = 0; in destroy_phar_manifest_entry()
390 if (entry->fp) { in destroy_phar_manifest_entry()
391 php_stream_close(entry->fp); in destroy_phar_manifest_entry()
392 entry->fp = 0; in destroy_phar_manifest_entry()
395 if (entry->metadata) { in destroy_phar_manifest_entry()
396 if (entry->is_persistent) { in destroy_phar_manifest_entry()
397 if (entry->metadata_len) { in destroy_phar_manifest_entry()
399 free(entry->metadata); in destroy_phar_manifest_entry()
401 zval_internal_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry()
404 zval_ptr_dtor(&entry->metadata); in destroy_phar_manifest_entry()
406 entry->metadata_len = 0; in destroy_phar_manifest_entry()
407 entry->metadata = 0; in destroy_phar_manifest_entry()
410 if (entry->metadata_str.c) { in destroy_phar_manifest_entry()
411 smart_str_free(&entry->metadata_str); in destroy_phar_manifest_entry()
412 entry->metadata_str.c = 0; in destroy_phar_manifest_entry()
415 pefree(entry->filename, entry->is_persistent); in destroy_phar_manifest_entry()
417 if (entry->link) { in destroy_phar_manifest_entry()
418 pefree(entry->link, entry->is_persistent); in destroy_phar_manifest_entry()
419 entry->link = 0; in destroy_phar_manifest_entry()
422 if (entry->tmp) { in destroy_phar_manifest_entry()
423 pefree(entry->tmp, entry->is_persistent); in destroy_phar_manifest_entry()
424 entry->tmp = 0; in destroy_phar_manifest_entry()
654 phar_entry_info entry; local
1052 memset(&entry, 0, sizeof(phar_entry_info));
1053 entry.phar = mydata;
1054 entry.fp_type = PHAR_FP;
1055 entry.is_persistent = mydata->is_persistent;
1062 PHAR_GET_32(buffer, entry.filename_len);
1064 if (entry.filename_len == 0) {
1068 if (entry.is_persistent) {
1069 entry.manifest_pos = manifest_index;
1072 if (entry.filename_len + 20 > endbuffer - buffer) {
1076 …if ((manifest_ver & PHAR_API_VER_MASK) >= PHAR_API_MIN_DIR && buffer[entry.filename_len - 1] == '/…
1077 entry.is_dir = 1;
1079 entry.is_dir = 0;
1082 phar_add_virtual_dirs(mydata, buffer, entry.filename_len TSRMLS_CC);
1083 entry.filename = pestrndup(buffer, entry.filename_len, entry.is_persistent);
1084 buffer += entry.filename_len;
1085 PHAR_GET_32(buffer, entry.uncompressed_filesize);
1086 PHAR_GET_32(buffer, entry.timestamp);
1089 mydata->min_timestamp = entry.timestamp;
1090 mydata->max_timestamp = entry.timestamp;
1092 if (mydata->min_timestamp > entry.timestamp) {
1093 mydata->min_timestamp = entry.timestamp;
1094 } else if (mydata->max_timestamp < entry.timestamp) {
1095 mydata->max_timestamp = entry.timestamp;
1099 PHAR_GET_32(buffer, entry.compressed_filesize);
1100 PHAR_GET_32(buffer, entry.crc32);
1101 PHAR_GET_32(buffer, entry.flags);
1103 if (entry.is_dir) {
1104 entry.filename_len--;
1105 entry.flags |= PHAR_ENT_PERM_DEF_DIR;
1109 if (entry.is_persistent) {
1110 entry.metadata_len = len;
1112 entry.metadata_len = 0;
1115 pefree(entry.filename, entry.is_persistent);
1118 if (phar_parse_metadata(&buffer, &entry.metadata, len TSRMLS_CC) == FAILURE) {
1119 pefree(entry.filename, entry.is_persistent);
1124 entry.offset = entry.offset_abs = offset;
1125 offset += entry.compressed_filesize;
1127 switch (entry.flags & PHAR_ENT_COMPRESSION_MASK) {
1130 if (entry.metadata) {
1131 if (entry.is_persistent) {
1132 free(entry.metadata);
1134 zval_ptr_dtor(&entry.metadata);
1137 pefree(entry.filename, entry.is_persistent);
1143 if (entry.metadata) {
1144 if (entry.is_persistent) {
1145 free(entry.metadata);
1147 zval_ptr_dtor(&entry.metadata);
1150 pefree(entry.filename, entry.is_persistent);
1155 if (entry.uncompressed_filesize != entry.compressed_filesize) {
1156 if (entry.metadata) {
1157 if (entry.is_persistent) {
1158 free(entry.metadata);
1160 zval_ptr_dtor(&entry.metadata);
1163 pefree(entry.filename, entry.is_persistent);
1169 manifest_flags |= (entry.flags & PHAR_ENT_COMPRESSION_MASK);
1171 entry.is_crc_checked = (manifest_flags & PHAR_HDR_SIGNATURE ? 1 : 0);
1172 phar_set_inode(&entry TSRMLS_CC);
1173 …zend_hash_add(&mydata->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_en…
2256 int phar_split_fname(char *filename, int filename_len, char **arch, int *arch_len, char **entry, in… argument
2307 *entry = estrndup(ext_str+ext_len, *entry_len);
2309 phar_unixify_path_separators(*entry, *entry_len);
2311 *entry = phar_fix_filepath(*entry, entry_len, 0 TSRMLS_CC);
2314 *entry = estrndup("/", 1);
2413 phar_entry_info *entry = idata->internal_file; local
2419 if (entry->is_zip && process_zip > 0) {
2425 … archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename);
2428 …php_stream_seek(phar_get_entrypfp(idata->internal_file TSRMLS_CC), entry->header_offset, SEEK_SET);
2432 …phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename);
2439 entry->header_offset + sizeof(local) +
2442 entry->compressed_filesize, SEEK_SET);
2445 … \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename);
2456 …entry->filename_len != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32)…
2457 …cal header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename);
2462 entry->offset = entry->offset_abs =
2463 …sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_l…
2465 if (idata->zero && idata->zero != entry->offset_abs) {
2466 idata->zero = entry->offset_abs;
2483 entry->is_crc_checked = 1;
2486 …l corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename);
2506 phar_entry_info *entry = (phar_entry_info *)data; local
2508 if (entry->fp_refcount <= 0 && entry->is_deleted) {
2574 phar_entry_info *entry, *newentry; local
2762 if (zend_hash_get_current_data(&phar->manifest, (void **)&entry) == FAILURE) {
2765 if (entry->cfp) {
2767 php_stream_close(entry->cfp);
2768 entry->cfp = 0;
2770 if (entry->is_deleted || entry->is_mounted) {
2774 if (!entry->is_modified && entry->fp_refcount) {
2776 switch (entry->fp_type) {
2788 phar_add_virtual_dirs(phar, entry->filename, entry->filename_len TSRMLS_CC);
2790 if (entry->is_dir) {
2794 if (entry->metadata) {
2795 if (entry->metadata_str.c) {
2796 smart_str_free(&entry->metadata_str);
2798 entry->metadata_str.c = 0;
2799 entry->metadata_str.len = 0;
2801 php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash TSRMLS_CC);
2804 if (entry->metadata_str.c) {
2805 smart_str_free(&entry->metadata_str);
2807 entry->metadata_str.c = 0;
2808 entry->metadata_str.len = 0;
2812 …offset += 4 + entry->filename_len + sizeof(entry_buffer) + entry->metadata_str.len + (entry->is_di…
2815 if ((oldfile && !entry->is_modified) || entry->is_dir) {
2816 if (entry->fp_type == PHAR_UFP) {
2818 entry->fp_type = PHAR_FP;
2822 if (!phar_get_efp(entry, 0 TSRMLS_CC)) {
2824 newentry = phar_open_jit(phar, entry, error TSRMLS_CC);
2831 entry = newentry;
2833 file = phar_get_efp(entry, 0 TSRMLS_CC);
2834 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC)) {
2840 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2845 mytime = entry->uncompressed_filesize;
2849 entry->crc32 = ~newcrc32;
2850 entry->is_crc_checked = 1;
2851 if (!(entry->flags & PHAR_ENT_COMPRESSION_MASK)) {
2853 entry->compressed_filesize = entry->uncompressed_filesize;
2856 filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0 TSRMLS_CC);
2862 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
2864 …spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar…
2868 …spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, pha…
2877 entry->cfp = php_stream_fopen_tmpfile();
2878 if (!entry->cfp) {
2889 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
2895 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2899 php_stream_filter_append((&entry->cfp->writefilters), filter);
2900 if (SUCCESS != phar_stream_copy_to_stream(file, entry->cfp, entry->uncompressed_filesize, NULL)) {
2906 … compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
2911 php_stream_flush(entry->cfp);
2913 php_stream_seek(entry->cfp, 0, SEEK_END);
2914 entry->compressed_filesize = (php_uint32) php_stream_tell(entry->cfp);
2916 php_stream_rewind(entry->cfp);
2917 entry->old_flags = entry->flags;
2918 entry->is_modified = 1;
2919 global_flags |= (entry->flags & PHAR_ENT_COMPRESSION_MASK);
3005 if (zend_hash_get_current_data(&phar->manifest, (void **)&entry) == FAILURE) {
3009 if (entry->is_deleted || entry->is_mounted) {
3014 if (entry->is_dir) {
3016 phar_set_32(entry_buffer, entry->filename_len + 1);
3018 phar_set_32(entry_buffer, entry->filename_len);
3022 || entry->filename_len != php_stream_write(newfile, entry->filename, entry->filename_len)
3023 || (entry->is_dir && 1 != php_stream_write(newfile, "/", 1))) {
3029 if (entry->is_dir) {
3030 …le to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
3032 …"unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
3048 phar_set_32(entry_buffer, entry->uncompressed_filesize);
3050 phar_set_32(entry_buffer+8, entry->compressed_filesize);
3051 phar_set_32(entry_buffer+12, entry->crc32);
3052 phar_set_32(entry_buffer+16, entry->flags);
3053 phar_set_32(entry_buffer+20, entry->metadata_str.len);
3056 …|| entry->metadata_str.len != php_stream_write(newfile, entry->metadata_str.c, entry->metadata_str…
3064 … write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->f…
3093 if (zend_hash_get_current_data(&phar->manifest, (void **)&entry) == FAILURE) {
3097 if (entry->is_deleted || entry->is_dir || entry->is_mounted) {
3101 if (entry->cfp) {
3102 file = entry->cfp;
3105 file = phar_get_efp(entry, 0 TSRMLS_CC);
3106 if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
3112 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3124 … "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->f…
3130 entry->offset = entry->offset_abs = offset;
3131 offset += entry->compressed_filesize;
3132 if (phar_stream_copy_to_stream(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) {
3140 …spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, …
3146 entry->is_modified = 0;
3148 if (entry->cfp) {
3149 php_stream_close(entry->cfp);
3150 entry->cfp = NULL;
3153 if (entry->fp_type == PHAR_MOD) {
3155 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
3156 php_stream_close(entry->fp);
3159 entry->fp = NULL;
3160 entry->fp_type = PHAR_FP;
3161 } else if (entry->fp_type == PHAR_UFP) {
3162 entry->fp_type = PHAR_FP;
3186 …ite contents of file \"%s\" to new phar \"%s\" with requested hash type", entry->filename, phar->f…