Lines Matching refs:fp

139 				php_stream_close(phar->fp);  in phar_split_cache_list()
140 phar->fp = NULL; in phar_split_cache_list()
251 if (phar->fp) { in PHP_INI_END()
252 php_stream_close(phar->fp); in PHP_INI_END()
253 phar->fp = 0; in PHP_INI_END()
285 if (phar->fp && (!(phar->flags & PHAR_FILE_COMPRESSION_MASK) || !phar->alias)) { in phar_archive_delref()
292 php_stream_close(phar->fp); in phar_archive_delref()
293 phar->fp = NULL; in phar_archive_delref()
342 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
343 php_stream_close(entry->fp); in phar_tmpclose_apply()
344 entry->fp = NULL; in phar_tmpclose_apply()
385 if (entry->fp) { in destroy_phar_manifest_entry_int()
386 php_stream_close(entry->fp); in destroy_phar_manifest_entry_int()
387 entry->fp = 0; in destroy_phar_manifest_entry_int()
441 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_delref()
442 php_stream_close(idata->fp); in phar_entry_delref()
467 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_remove()
468 php_stream_close(idata->fp); in phar_entry_remove()
485 if (fp) {\
486 php_stream_close(fp);\
664 static int phar_parse_pharfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t a… argument
687 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) {
693 if (3 != php_stream_read(fp, buffer, 3)) {
700 if (EOF == (nextchar = php_stream_getc(fp))) {
706 if (EOF == (nextchar = php_stream_getc(fp)) || (char)nextchar != '\n') {
718 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) {
725 if (4 != php_stream_read(fp, buffer, 4)) {
740 …if (manifest_len < MANIFEST_FIXED_LEN || manifest_len != php_stream_read(fp, buffer, manifest_len)…
758 php_stream_close(fp);
779 if (-1 == php_stream_seek(fp, -8, SEEK_END)
780 || (read_len = php_stream_tell(fp)) < 20
781 || 8 != php_stream_read(fp, sig_buf, 8)
784 php_stream_close(fp);
800 if (-1 == php_stream_seek(fp, -12, SEEK_CUR)
801 || 4 != php_stream_read(fp, sig_buf, 4)) {
803 php_stream_close(fp);
816 if (-1 == php_stream_seek(fp, whence, SEEK_CUR)
817 || !(end_of_phar = php_stream_tell(fp))
818 || signature_len != php_stream_read(fp, sig, signature_len)) {
821 php_stream_close(fp);
828 …if (FAILURE == phar_verify_signature(fp, end_of_phar, PHAR_SIG_OPENSSL, sig, signature_len, fname,…
831 php_stream_close(fp);
846 php_stream_seek(fp, -(8 + 64), SEEK_END);
847 read_len = php_stream_tell(fp);
849 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
851 php_stream_close(fp);
858 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &si…
860 php_stream_close(fp);
873 php_stream_seek(fp, -(8 + 32), SEEK_END);
874 read_len = php_stream_tell(fp);
876 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
878 php_stream_close(fp);
885 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &si…
887 php_stream_close(fp);
901 php_stream_close(fp);
911 php_stream_seek(fp, -(8 + 20), SEEK_END);
912 read_len = php_stream_tell(fp);
914 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
916 php_stream_close(fp);
923 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &sign…
925 php_stream_close(fp);
938 php_stream_seek(fp, -(8 + 16), SEEK_END);
939 read_len = php_stream_tell(fp);
941 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
943 php_stream_close(fp);
950 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signa…
952 php_stream_close(fp);
964 php_stream_close(fp);
973 php_stream_close(fp);
1000 php_stream_close(fp);
1218 mydata->fp = fp;
1230 fp = NULL;
1237 fp = NULL;
1353 php_stream *fp; local
1365 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, &actual);
1372 if (fp) {
1373 …if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error) == S…
1440 mydata->fp = NULL;
1506 php_stream *fp; local
1527 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, &actual);
1529 if (!fp) {
1546 ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error);
1590 static int phar_open_from_fp(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t ali… argument
1609 if (-1 == php_stream_rewind(fp)) {
1619 while(!php_stream_eof(fp)) {
1620 if ((got = php_stream_read(fp, buffer+tokenlen, readsize)) < (size_t) tokenlen) {
1649 php_stream_rewind(fp);
1650 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
1655 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
1668 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) {
1679 php_stream_close(fp);
1680 fp = temp;
1681 php_stream_rewind(fp);
1700 php_stream_rewind(fp);
1701 filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp));
1710 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) {
1717 php_stream_close(fp);
1718 fp = temp;
1719 php_stream_rewind(fp);
1728 php_stream_seek(fp, 0, SEEK_END);
1729 return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error);
1734 php_stream_rewind(fp);
1735 …return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, err…
1742 …return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression…
2287 php_stream *fp; local
2321 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, &actual);
2323 if (!fp) {
2338 ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error);
2355 php_stream *fp = idata->fp; local
2417 php_stream_seek(fp, idata->zero, SEEK_SET);
2420 CRC32(crc, php_stream_getc(fp));
2423 php_stream_seek(fp, idata->zero, SEEK_SET);
2557 if (phar->fp && !phar->is_brandnew) {
2558 oldfile = phar->fp;
3094 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
3095 php_stream_close(entry->fp);
3098 entry->fp = NULL;
3166 if (phar->fp && free_fp) {
3167 php_stream_close(phar->fp);
3189 phar->fp = newfile;
3191 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, …
3192 if (!phar->fp) {
3193 phar->fp = newfile;
3206 …lter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
3216 php_stream_filter_append(&phar->fp->writefilters, filter);
3217 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3220 php_stream_close(phar->fp);
3222 phar->fp = newfile;
3224 filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
3225 php_stream_filter_append(&phar->fp->writefilters, filter);
3226 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3229 php_stream_close(phar->fp);
3231 phar->fp = newfile;
3233 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3239 if (-1 == php_stream_seek(phar->fp, phar->halt_offset, SEEK_SET)) {
3338 php_stream_rewind(PHAR_G(cached_fp)[phar->phar_pos].fp) :
3339 php_stream_rewind(phar->fp);
3536 if (PHAR_G(cached_fp)[i].fp) {
3537 php_stream_close(PHAR_G(cached_fp)[i].fp);