Lines Matching refs:fp

141 				php_stream_close(phar->fp);  in phar_split_cache_list()
142 phar->fp = NULL; in phar_split_cache_list()
253 if (phar->fp) { in PHP_INI_END()
254 php_stream_close(phar->fp); in PHP_INI_END()
255 phar->fp = 0; in PHP_INI_END()
287 if (phar->fp && (!(phar->flags & PHAR_FILE_COMPRESSION_MASK) || !phar->alias)) { in phar_archive_delref()
294 php_stream_close(phar->fp); in phar_archive_delref()
295 phar->fp = NULL; in phar_archive_delref()
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()
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()
443 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_delref()
444 php_stream_close(idata->fp); in phar_entry_delref()
469 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_remove()
470 php_stream_close(idata->fp); in phar_entry_remove()
487 if (fp) {\
488 php_stream_close(fp);\
666 static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_l… 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);
1212 mydata->fp = fp;
1224 fp = NULL;
1231 fp = NULL;
1335 php_stream *fp; local
1347 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, &actual);
1354 if (fp) {
1355 …if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error) == S…
1422 mydata->fp = NULL;
1488 php_stream *fp; local
1509 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, &actual);
1511 if (!fp) {
1528 ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error);
1572 static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len… argument
1591 if (-1 == php_stream_rewind(fp)) {
1601 while(!php_stream_eof(fp)) {
1602 if ((got = php_stream_read(fp, buffer+tokenlen, readsize)) < (size_t) tokenlen) {
1631 php_stream_rewind(fp);
1632 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
1637 filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
1650 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) {
1661 php_stream_close(fp);
1662 fp = temp;
1663 php_stream_rewind(fp);
1682 php_stream_rewind(fp);
1683 filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp));
1692 if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) {
1699 php_stream_close(fp);
1700 fp = temp;
1701 php_stream_rewind(fp);
1710 php_stream_seek(fp, 0, SEEK_END);
1711 return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error);
1716 php_stream_rewind(fp);
1717 …return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, err…
1724 …return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression…
2273 php_stream *fp; local
2307 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, &actual);
2309 if (!fp) {
2324 ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error);
2341 php_stream *fp = idata->fp; local
2403 php_stream_seek(fp, idata->zero, SEEK_SET);
2406 CRC32(crc, php_stream_getc(fp));
2409 php_stream_seek(fp, idata->zero, SEEK_SET);
2542 if (phar->fp && !phar->is_brandnew) {
2543 oldfile = phar->fp;
3079 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
3080 php_stream_close(entry->fp);
3083 entry->fp = NULL;
3151 if (phar->fp && free_fp) {
3152 php_stream_close(phar->fp);
3174 phar->fp = newfile;
3176 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, …
3177 if (!phar->fp) {
3178 phar->fp = newfile;
3191 …lter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
3201 php_stream_filter_append(&phar->fp->writefilters, filter);
3202 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3205 php_stream_close(phar->fp);
3207 phar->fp = newfile;
3209 filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
3210 php_stream_filter_append(&phar->fp->writefilters, filter);
3211 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3214 php_stream_close(phar->fp);
3216 phar->fp = newfile;
3218 php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3224 if (-1 == php_stream_seek(phar->fp, phar->halt_offset, SEEK_SET)) {
3323 php_stream_rewind(PHAR_G(cached_fp)[phar->phar_pos].fp) :
3324 php_stream_rewind(phar->fp);
3521 if (PHAR_G(cached_fp)[i].fp) {
3522 php_stream_close(PHAR_G(cached_fp)[i].fp);