Lines Matching refs:fp

133 			php_stream_close(phar->fp);  in phar_split_cache_list()
134 phar->fp = NULL; in phar_split_cache_list()
224 if (phar->fp) { in PHP_INI_END()
225 php_stream_close(phar->fp); in PHP_INI_END()
226 phar->fp = 0; in PHP_INI_END()
258 if (phar->fp && (!(phar->flags & PHAR_FILE_COMPRESSION_MASK) || !phar->alias)) { in phar_archive_delref()
265 php_stream_close(phar->fp); in phar_archive_delref()
266 phar->fp = NULL; in phar_archive_delref()
315 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
316 php_stream_close(entry->fp); in phar_tmpclose_apply()
317 entry->fp = NULL; in phar_tmpclose_apply()
358 if (entry->fp) { in destroy_phar_manifest_entry_int()
359 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
360 entry->fp = 0; in destroy_phar_manifest_entry_int()
394 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_delref()
395 php_stream_close(idata->fp); in phar_entry_delref()
419 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_remove()
420 php_stream_close(idata->fp); in phar_entry_remove()
437 if (fp) {\
438 php_stream_close(fp);\
728 static int phar_parse_pharfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t a… in phar_parse_pharfile() argument
751 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) { in phar_parse_pharfile()
757 if (3 != php_stream_read(fp, buffer, 3)) { in phar_parse_pharfile()
764 if (EOF == (nextchar = php_stream_getc(fp))) { in phar_parse_pharfile()
770 if (EOF == (nextchar = php_stream_getc(fp)) || (char)nextchar != '\n') { in phar_parse_pharfile()
782 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) { in phar_parse_pharfile()
789 if (4 != php_stream_read(fp, buffer, 4)) { in phar_parse_pharfile()
804 …if (manifest_len < MANIFEST_FIXED_LEN || manifest_len != php_stream_read(fp, buffer, manifest_len)… in phar_parse_pharfile()
822 php_stream_close(fp); in phar_parse_pharfile()
843 if (-1 == php_stream_seek(fp, -8, SEEK_END) in phar_parse_pharfile()
844 || (read_len = php_stream_tell(fp)) < 20 in phar_parse_pharfile()
845 || 8 != php_stream_read(fp, sig_buf, 8) in phar_parse_pharfile()
848 php_stream_close(fp); in phar_parse_pharfile()
866 if (-1 == php_stream_seek(fp, -12, SEEK_CUR) in phar_parse_pharfile()
867 || 4 != php_stream_read(fp, sig_buf, 4)) { in phar_parse_pharfile()
869 php_stream_close(fp); in phar_parse_pharfile()
882 if (-1 == php_stream_seek(fp, whence, SEEK_CUR) in phar_parse_pharfile()
883 || !(end_of_phar = php_stream_tell(fp)) in phar_parse_pharfile()
884 || signature_len != php_stream_read(fp, sig, signature_len)) { in phar_parse_pharfile()
887 php_stream_close(fp); in phar_parse_pharfile()
894 …if (FAILURE == phar_verify_signature(fp, end_of_phar, sig_flags, sig, signature_len, fname, &signa… in phar_parse_pharfile()
897 php_stream_close(fp); in phar_parse_pharfile()
911 php_stream_seek(fp, -(8 + 64), SEEK_END); in phar_parse_pharfile()
912 read_len = php_stream_tell(fp); in phar_parse_pharfile()
914 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
916 php_stream_close(fp); in phar_parse_pharfile()
923 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &si… in phar_parse_pharfile()
925 php_stream_close(fp); in phar_parse_pharfile()
938 php_stream_seek(fp, -(8 + 32), SEEK_END); in phar_parse_pharfile()
939 read_len = php_stream_tell(fp); in phar_parse_pharfile()
941 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
943 php_stream_close(fp); in phar_parse_pharfile()
950 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &si… in phar_parse_pharfile()
952 php_stream_close(fp); in phar_parse_pharfile()
965 php_stream_seek(fp, -(8 + 20), SEEK_END); in phar_parse_pharfile()
966 read_len = php_stream_tell(fp); in phar_parse_pharfile()
968 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
970 php_stream_close(fp); in phar_parse_pharfile()
977 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &sign… in phar_parse_pharfile()
979 php_stream_close(fp); in phar_parse_pharfile()
992 php_stream_seek(fp, -(8 + 16), SEEK_END); in phar_parse_pharfile()
993 read_len = php_stream_tell(fp); in phar_parse_pharfile()
995 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) { in phar_parse_pharfile()
997 php_stream_close(fp); in phar_parse_pharfile()
1004 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signa… in phar_parse_pharfile()
1006 php_stream_close(fp); in phar_parse_pharfile()
1018 php_stream_close(fp); in phar_parse_pharfile()
1027 php_stream_close(fp); in phar_parse_pharfile()
1054 php_stream_close(fp); in phar_parse_pharfile()
1250 mydata->fp = fp; in phar_parse_pharfile()
1262 fp = NULL; in phar_parse_pharfile()
1269 fp = NULL; in phar_parse_pharfile()
1385 php_stream *fp; in phar_create_or_parse_filename() local
1397 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, &actual); in phar_create_or_parse_filename()
1404 if (fp) { in phar_create_or_parse_filename()
1405 …if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error) == S… in phar_create_or_parse_filename()
1471 mydata->fp = NULL; in phar_create_or_parse_filename()
1537 php_stream *fp; in phar_open_from_filename() local
1558 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, &actual); in phar_open_from_filename()
1560 if (!fp) { in phar_open_from_filename()
1577 ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error); in phar_open_from_filename()
1621 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
1641 if (-1 == php_stream_rewind(fp)) { in phar_open_from_fp()
1651 while(!php_stream_eof(fp)) { in phar_open_from_fp()
1652 if ((got = php_stream_read(fp, buffer+tokenlen, readsize)) < (size_t) tokenlen) { in phar_open_from_fp()
1681 php_stream_rewind(fp); in phar_open_from_fp()
1682 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp)); in phar_open_from_fp()
1687 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp)); in phar_open_from_fp()
1700 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { in phar_open_from_fp()
1711 php_stream_close(fp); in phar_open_from_fp()
1712 fp = temp; in phar_open_from_fp()
1713 php_stream_rewind(fp); in phar_open_from_fp()
1736 php_stream_rewind(fp); in phar_open_from_fp()
1737 filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp)); in phar_open_from_fp()
1746 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { in phar_open_from_fp()
1753 php_stream_close(fp); in phar_open_from_fp()
1754 fp = temp; in phar_open_from_fp()
1755 php_stream_rewind(fp); in phar_open_from_fp()
1768 php_stream_seek(fp, 0, SEEK_END); in phar_open_from_fp()
1769 return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error); in phar_open_from_fp()
1774 php_stream_rewind(fp); in phar_open_from_fp()
1775 …return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, err… in phar_open_from_fp()
1782 …return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression… in phar_open_from_fp()
2348 php_stream *fp; in phar_open_executed_filename() local
2349fp = php_stream_open_wrapper(ZSTR_VAL(fname), "rb", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, &ac… in phar_open_executed_filename()
2351 if (!fp) { in phar_open_executed_filename()
2365 …int ret = phar_open_from_fp(fp, ZSTR_VAL(fname), ZSTR_LEN(fname), alias, alias_len, REPORT_ERRORS,… in phar_open_executed_filename()
2382 php_stream *fp = idata->fp; in phar_postprocess_file() local
2444 php_stream_seek(fp, idata->zero, SEEK_SET); in phar_postprocess_file()
2446 ret = php_crc32_stream_bulk_update(&crc, fp, len); in phar_postprocess_file()
2448 php_stream_seek(fp, idata->zero, SEEK_SET); in phar_postprocess_file()
2582 if (phar->fp && !phar->is_brandnew) { in phar_flush()
2583 oldfile = phar->fp; in phar_flush()
3097 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) { in phar_flush()
3098 php_stream_close(entry->fp); in phar_flush()
3101 entry->fp = NULL; in phar_flush()
3164 if (phar->fp && free_fp) { in phar_flush()
3165 php_stream_close(phar->fp); in phar_flush()
3186 phar->fp = newfile; in phar_flush()
3188 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, … in phar_flush()
3189 if (!phar->fp) { in phar_flush()
3190 phar->fp = newfile; in phar_flush()
3203 …lter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp)); in phar_flush()
3213 php_stream_filter_append(&phar->fp->writefilters, filter); in phar_flush()
3214 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_flush()
3217 php_stream_close(phar->fp); in phar_flush()
3219 phar->fp = newfile; in phar_flush()
3221 filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp)); in phar_flush()
3222 php_stream_filter_append(&phar->fp->writefilters, filter); in phar_flush()
3223 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_flush()
3226 php_stream_close(phar->fp); in phar_flush()
3228 phar->fp = newfile; in phar_flush()
3230 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_flush()
3236 if (-1 == php_stream_seek(phar->fp, phar->halt_offset, SEEK_SET)) { in phar_flush()
3337 php_stream_rewind(PHAR_G(cached_fp)[phar->phar_pos].fp) : in phar_compile_file()
3338 php_stream_rewind(phar->fp); in phar_compile_file()
3533 if (PHAR_G(cached_fp)[i].fp) { in PHP_RSHUTDOWN_FUNCTION()
3534 php_stream_close(PHAR_G(cached_fp)[i].fp); in PHP_RSHUTDOWN_FUNCTION()