Lines Matching refs:fp

143 			php_stream_close(phar->fp);  in phar_split_cache_list()
144 phar->fp = NULL; in phar_split_cache_list()
247 if (phar->fp) { in PHP_INI_END()
248 php_stream_close(phar->fp); in PHP_INI_END()
249 phar->fp = 0; in PHP_INI_END()
281 if (phar->fp && (!(phar->flags & PHAR_FILE_COMPRESSION_MASK) || !phar->alias)) { in phar_archive_delref()
288 php_stream_close(phar->fp); in phar_archive_delref()
289 phar->fp = NULL; in phar_archive_delref()
338 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
339 php_stream_close(entry->fp); in phar_tmpclose_apply()
340 entry->fp = NULL; in phar_tmpclose_apply()
381 if (entry->fp) { in destroy_phar_manifest_entry_int()
382 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
383 entry->fp = 0; in destroy_phar_manifest_entry_int()
437 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_delref()
438 php_stream_close(idata->fp); in phar_entry_delref()
463 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_remove()
464 php_stream_close(idata->fp); in phar_entry_remove()
481 if (fp) {\
482 php_stream_close(fp);\
667 static int phar_parse_pharfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t a… in phar_parse_pharfile() argument
690 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) { in phar_parse_pharfile()
696 if (3 != php_stream_read(fp, buffer, 3)) { in phar_parse_pharfile()
703 if (EOF == (nextchar = php_stream_getc(fp))) { in phar_parse_pharfile()
709 if (EOF == (nextchar = php_stream_getc(fp)) || (char)nextchar != '\n') { in phar_parse_pharfile()
721 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) { in phar_parse_pharfile()
728 if (4 != php_stream_read(fp, buffer, 4)) { in phar_parse_pharfile()
743 …if (manifest_len < MANIFEST_FIXED_LEN || manifest_len != php_stream_read(fp, buffer, manifest_len)… in phar_parse_pharfile()
761 php_stream_close(fp); in phar_parse_pharfile()
782 if (-1 == php_stream_seek(fp, -8, SEEK_END) in phar_parse_pharfile()
783 || (read_len = php_stream_tell(fp)) < 20 in phar_parse_pharfile()
784 || 8 != php_stream_read(fp, sig_buf, 8) in phar_parse_pharfile()
787 php_stream_close(fp); in phar_parse_pharfile()
803 if (-1 == php_stream_seek(fp, -12, SEEK_CUR) in phar_parse_pharfile()
804 || 4 != php_stream_read(fp, sig_buf, 4)) { in phar_parse_pharfile()
806 php_stream_close(fp); in phar_parse_pharfile()
819 if (-1 == php_stream_seek(fp, whence, SEEK_CUR) in phar_parse_pharfile()
820 || !(end_of_phar = php_stream_tell(fp)) in phar_parse_pharfile()
821 || signature_len != php_stream_read(fp, sig, signature_len)) { in phar_parse_pharfile()
824 php_stream_close(fp); in phar_parse_pharfile()
831 …if (FAILURE == phar_verify_signature(fp, end_of_phar, PHAR_SIG_OPENSSL, sig, signature_len, fname,… in phar_parse_pharfile()
834 php_stream_close(fp); in phar_parse_pharfile()
848 php_stream_seek(fp, -(8 + 64), SEEK_END); in phar_parse_pharfile()
849 read_len = php_stream_tell(fp); in phar_parse_pharfile()
851 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
853 php_stream_close(fp); in phar_parse_pharfile()
860 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &si… in phar_parse_pharfile()
862 php_stream_close(fp); in phar_parse_pharfile()
875 php_stream_seek(fp, -(8 + 32), SEEK_END); in phar_parse_pharfile()
876 read_len = php_stream_tell(fp); in phar_parse_pharfile()
878 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
880 php_stream_close(fp); in phar_parse_pharfile()
887 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &si… in phar_parse_pharfile()
889 php_stream_close(fp); in phar_parse_pharfile()
902 php_stream_seek(fp, -(8 + 20), SEEK_END); in phar_parse_pharfile()
903 read_len = php_stream_tell(fp); in phar_parse_pharfile()
905 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
907 php_stream_close(fp); in phar_parse_pharfile()
914 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &sign… in phar_parse_pharfile()
916 php_stream_close(fp); in phar_parse_pharfile()
929 php_stream_seek(fp, -(8 + 16), SEEK_END); in phar_parse_pharfile()
930 read_len = php_stream_tell(fp); in phar_parse_pharfile()
932 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
934 php_stream_close(fp); in phar_parse_pharfile()
941 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signa… in phar_parse_pharfile()
943 php_stream_close(fp); in phar_parse_pharfile()
955 php_stream_close(fp); in phar_parse_pharfile()
964 php_stream_close(fp); in phar_parse_pharfile()
991 php_stream_close(fp); in phar_parse_pharfile()
1209 mydata->fp = fp; in phar_parse_pharfile()
1221 fp = NULL; in phar_parse_pharfile()
1228 fp = NULL; in phar_parse_pharfile()
1344 php_stream *fp; in phar_create_or_parse_filename() local
1356 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, &actual); in phar_create_or_parse_filename()
1363 if (fp) { in phar_create_or_parse_filename()
1364 …if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error) == S… in phar_create_or_parse_filename()
1431 mydata->fp = NULL; in phar_create_or_parse_filename()
1497 php_stream *fp; in phar_open_from_filename() local
1518 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, &actual); in phar_open_from_filename()
1520 if (!fp) { in phar_open_from_filename()
1537 ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error); in phar_open_from_filename()
1581 static int phar_open_from_fp(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t ali… in phar_open_from_fp() argument
1601 if (-1 == php_stream_rewind(fp)) { in phar_open_from_fp()
1611 while(!php_stream_eof(fp)) { in phar_open_from_fp()
1612 if ((got = php_stream_read(fp, buffer+tokenlen, readsize)) < (size_t) tokenlen) { in phar_open_from_fp()
1641 php_stream_rewind(fp); in phar_open_from_fp()
1642 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp)); in phar_open_from_fp()
1647 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp)); in phar_open_from_fp()
1660 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { in phar_open_from_fp()
1671 php_stream_close(fp); in phar_open_from_fp()
1672 fp = temp; in phar_open_from_fp()
1673 php_stream_rewind(fp); in phar_open_from_fp()
1696 php_stream_rewind(fp); in phar_open_from_fp()
1697 filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp)); in phar_open_from_fp()
1706 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { in phar_open_from_fp()
1713 php_stream_close(fp); in phar_open_from_fp()
1714 fp = temp; in phar_open_from_fp()
1715 php_stream_rewind(fp); in phar_open_from_fp()
1728 php_stream_seek(fp, 0, SEEK_END); in phar_open_from_fp()
1729 return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error); in phar_open_from_fp()
1734 php_stream_rewind(fp); in phar_open_from_fp()
1735 …return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, err… in phar_open_from_fp()
1742 …return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression… in phar_open_from_fp()
2280 php_stream *fp; in phar_open_executed_filename() local
2314 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, &actual); in phar_open_executed_filename()
2316 if (!fp) { in phar_open_executed_filename()
2331 ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error); in phar_open_executed_filename()
2348 php_stream *fp = idata->fp; in phar_postprocess_file() local
2410 php_stream_seek(fp, idata->zero, SEEK_SET); in phar_postprocess_file()
2413 CRC32(crc, php_stream_getc(fp)); in phar_postprocess_file()
2416 php_stream_seek(fp, idata->zero, SEEK_SET); in phar_postprocess_file()
2551 if (phar->fp && !phar->is_brandnew) { in phar_flush()
2552 oldfile = phar->fp; in phar_flush()
3074 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) { in phar_flush()
3075 php_stream_close(entry->fp); in phar_flush()
3078 entry->fp = NULL; in phar_flush()
3139 if (phar->fp && free_fp) { in phar_flush()
3140 php_stream_close(phar->fp); in phar_flush()
3162 phar->fp = newfile; in phar_flush()
3164 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, … in phar_flush()
3165 if (!phar->fp) { in phar_flush()
3166 phar->fp = newfile; in phar_flush()
3179 …lter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp)); in phar_flush()
3189 php_stream_filter_append(&phar->fp->writefilters, filter); in phar_flush()
3190 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_flush()
3193 php_stream_close(phar->fp); in phar_flush()
3195 phar->fp = newfile; in phar_flush()
3197 filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp)); in phar_flush()
3198 php_stream_filter_append(&phar->fp->writefilters, filter); in phar_flush()
3199 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_flush()
3202 php_stream_close(phar->fp); in phar_flush()
3204 phar->fp = newfile; in phar_flush()
3206 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_flush()
3212 if (-1 == php_stream_seek(phar->fp, phar->halt_offset, SEEK_SET)) { in phar_flush()
3323 php_stream_rewind(PHAR_G(cached_fp)[phar->phar_pos].fp) : in phar_compile_file()
3324 php_stream_rewind(phar->fp); in phar_compile_file()
3522 if (PHAR_G(cached_fp)[i].fp) { in PHP_RSHUTDOWN_FUNCTION()
3523 php_stream_close(PHAR_G(cached_fp)[i].fp); in PHP_RSHUTDOWN_FUNCTION()