Lines Matching refs:fp

144 				php_stream_close(phar->fp);  in phar_split_cache_list()
145 phar->fp = NULL; in phar_split_cache_list()
256 if (phar->fp) { in PHP_INI_END()
257 php_stream_close(phar->fp); in PHP_INI_END()
258 phar->fp = 0; in PHP_INI_END()
290 if (phar->fp && !(phar->flags & PHAR_FILE_COMPRESSION_MASK)) { in phar_archive_delref()
295 php_stream_close(phar->fp); in phar_archive_delref()
296 phar->fp = NULL; in phar_archive_delref()
346 if (entry->fp && !entry->fp_refcount) { in phar_tmpclose_apply()
347 php_stream_close(entry->fp); in phar_tmpclose_apply()
348 entry->fp = NULL; in phar_tmpclose_apply()
392 if (entry->fp) { in destroy_phar_manifest_entry()
393 php_stream_close(entry->fp); in destroy_phar_manifest_entry()
394 entry->fp = 0; in destroy_phar_manifest_entry()
440 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_delref()
441 php_stream_close(idata->fp); in phar_entry_delref()
466 …if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != ida… in phar_entry_remove()
467 php_stream_close(idata->fp); in phar_entry_remove()
484 if (fp) {\
485 php_stream_close(fp);\
651 static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_l… argument
672 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) {
678 if (3 != php_stream_read(fp, buffer, 3)) {
685 if (EOF == (nextchar = php_stream_getc(fp))) {
691 if (EOF == (nextchar = php_stream_getc(fp)) || (char)nextchar != '\n') {
703 if (-1 == php_stream_seek(fp, halt_offset, SEEK_SET)) {
710 if (4 != php_stream_read(fp, buffer, 4)) {
725 if (manifest_len < 10 || manifest_len != php_stream_read(fp, buffer, manifest_len)) {
743 php_stream_close(fp);
764 if (-1 == php_stream_seek(fp, -8, SEEK_END)
765 || (read_len = php_stream_tell(fp)) < 20
766 || 8 != php_stream_read(fp, sig_buf, 8)
769 php_stream_close(fp);
785 if (-1 == php_stream_seek(fp, -12, SEEK_CUR)
786 || 4 != php_stream_read(fp, sig_buf, 4)) {
788 php_stream_close(fp);
801 if (-1 == php_stream_seek(fp, whence, SEEK_CUR)
802 || !(end_of_phar = php_stream_tell(fp))
803 || signature_len != php_stream_read(fp, sig, signature_len)) {
806 php_stream_close(fp);
813 …if (FAILURE == phar_verify_signature(fp, end_of_phar, PHAR_SIG_OPENSSL, sig, signature_len, fname,…
816 php_stream_close(fp);
831 php_stream_seek(fp, -(8 + 64), SEEK_END);
832 read_len = php_stream_tell(fp);
834 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
836 php_stream_close(fp);
843 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &si…
845 php_stream_close(fp);
858 php_stream_seek(fp, -(8 + 32), SEEK_END);
859 read_len = php_stream_tell(fp);
861 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
863 php_stream_close(fp);
870 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &si…
872 php_stream_close(fp);
886 php_stream_close(fp);
896 php_stream_seek(fp, -(8 + 20), SEEK_END);
897 read_len = php_stream_tell(fp);
899 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
901 php_stream_close(fp);
908 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &sign…
910 php_stream_close(fp);
923 php_stream_seek(fp, -(8 + 16), SEEK_END);
924 read_len = php_stream_tell(fp);
926 if (php_stream_read(fp, (char*)digest, sizeof(digest)) != sizeof(digest)) {
928 php_stream_close(fp);
935 …if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signa…
937 php_stream_close(fp);
949 php_stream_close(fp);
958 php_stream_close(fp);
986 php_stream_close(fp);
1198 mydata->fp = fp;
1210 fp = NULL;
1217 fp = NULL;
1321 php_stream *fp; local
1337 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, &actual);
1344 if (fp) {
1345 …if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error TSRML…
1408 mydata->fp = NULL;
1474 php_stream *fp; local
1500 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, &actual);
1502 if (!fp) {
1519 …ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error TS…
1563 static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len… argument
1582 if (-1 == php_stream_rewind(fp)) {
1592 while(!php_stream_eof(fp)) {
1593 if ((got = php_stream_read(fp, buffer+tokenlen, readsize)) < (size_t) tokenlen) {
1622 php_stream_rewind(fp);
1623 …filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRM…
1628 …filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRM…
1641 if (SUCCESS != phar_stream_copy_to_stream(fp, temp, PHP_STREAM_COPY_ALL, NULL)) {
1652 php_stream_close(fp);
1653 fp = temp;
1654 php_stream_rewind(fp);
1673 php_stream_rewind(fp);
1674 …filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp) TSRMLS_CC…
1683 if (SUCCESS != phar_stream_copy_to_stream(fp, temp, PHP_STREAM_COPY_ALL, NULL)) {
1690 php_stream_close(fp);
1691 fp = temp;
1692 php_stream_rewind(fp);
1701 php_stream_seek(fp, 0, SEEK_END);
1702 return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error TSRMLS_CC);
1707 php_stream_rewind(fp);
1708 …return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, err…
1715 …return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression…
2330 php_stream *fp; local
2375 fp = php_stream_open_wrapper(fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, &actual);
2377 if (!fp) {
2392 …ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error TSRM…
2409 php_stream *fp = idata->fp; local
2471 php_stream_seek(fp, idata->zero, SEEK_SET);
2474 CRC32(crc, php_stream_getc(fp));
2477 php_stream_seek(fp, idata->zero, SEEK_SET);
2616 if (phar->fp && !phar->is_brandnew) {
2617 oldfile = phar->fp;
3152 if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
3153 php_stream_close(entry->fp);
3156 entry->fp = NULL;
3224 if (phar->fp && free_fp) {
3225 php_stream_close(phar->fp);
3247 phar->fp = newfile;
3249 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, …
3250 if (!phar->fp) {
3251 phar->fp = newfile;
3264 …_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp) TSRMLS_CC);
3274 php_stream_filter_append(&phar->fp->writefilters, filter);
3275 phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3278 php_stream_close(phar->fp);
3280 phar->fp = newfile;
3282 …filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp) TSRML…
3283 php_stream_filter_append(&phar->fp->writefilters, filter);
3284 phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3287 php_stream_close(phar->fp);
3289 phar->fp = newfile;
3291 phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
3297 if (-1 == php_stream_seek(phar->fp, phar->halt_offset, SEEK_SET)) {
3393 php_stream_rewind(PHAR_GLOBALS->cached_fp[phar->phar_pos].fp) :
3394 php_stream_rewind(phar->fp);
3405 php_stream_rewind(PHAR_GLOBALS->cached_fp[phar->phar_pos].fp) :
3406 php_stream_rewind(phar->fp);
3658 if (PHAR_GLOBALS->cached_fp[i].fp) {
3659 php_stream_close(PHAR_GLOBALS->cached_fp[i].fp);