Questions tagged [php-stream-wrappers]

PHP provides a number of miscellaneous I/O streams that allow access to PHP's own input and output streams, the standard input, output and error file descriptors, in-memory and disk-backed temporary file streams, and filters that can manipulate other file resources as they are read from and written to.

PHP provides a number of miscellaneous I/O streams that allow access to PHP's own input and output streams, the standard input, output and error file descriptors, in-memory and disk-backed temporary file streams, and filters that can manipulate other file resources as they are read from and written to.

Some of the supported streams are:

  • php://stdin,
  • php://stdout
  • php://stderr
  • php://input
  • php://output
  • php://fd
  • php://memory
  • php://temp
  • php://filter
48 questions
1
vote
1 answer

How To Read A File in php wrappers as utf-16

Is there a way to read a file in a specific character encoding like UTF-16 using PHP's stream wrappers, in the same way I can read a base64-encoded file using php://filter/convert.base64-decode/resource=file.txt?
Ali Saleh
  • 23
  • 4
1
vote
0 answers

How to pass options to stream_open in google cloud PHP stream wrapper

I'm trying to serve large audio files from google cloud storage with seeking support. I have difficulties understanding php fopen and google stream wrapper working together. When fopen is called it immediately calls stream_open from google…
Iko
  • 11
  • 1
1
vote
1 answer

How to read content from 'php://output' stream

According to the docs php://output is only a writable stream, is there any way to read whatever was streamed to it as a content(possibilly a string); $content = fopen('php://output',r); tried above code but no use.
1
vote
0 answers

How to set the default chunk size for a custom PHP stream wrapper

When using a stream wrapper for PHP, the chunk size can be set on the client side with stream_set_chunk_size However, is there anyway to specify the chunk size from a custom stream wrapper implementation itself? For example, an implementation of…
David Thomas
  • 4,027
  • 3
  • 28
  • 22
1
vote
0 answers

CURLOPT_USERPWD equivalent with stream_context_create

is it possible to set USERPWD while using stream_context_create? I have tried like that $opts = array( 'http'=>array( 'method'=>"GET", 'header' => "Authorization: Basic " . base64_encode("$username:$password") …
JackSmith
  • 85
  • 1
  • 10
1
vote
1 answer

PHP CURL PUT from Amazon S3 stream wrapper (tcp stream)

I'm trying to (PHP) cURL PUT a file from Amazon S3 to Vimeo using S3 stream wrapper (s3://...) and getting the follow error: curl_setopt_array(): cannot represent a stream of type tcp_socket/ssl as a STDIO FILE in [...] Is there a way to cURL PUT…
Martin Buezas
  • 384
  • 2
  • 9
1
vote
0 answers

Poll and Output script's status to the Command Line

My script processes data, and like a flow chart, upcoming actions depend on the results of the previous action. I'd like to output text to the command line after each action, and have the script continue to execute until finished. Something…
LookingToLearn
  • 303
  • 3
  • 8
1
vote
0 answers

consumed bytes for php_user_filter::filter

According to http://php.net/manual/en/php-user-filter.filter.php "consumed, which must always be declared by reference, should be incremented by the length of the data which your filter reads in and alters. In most cases this means you will…
neubert
  • 15,947
  • 24
  • 120
  • 212
1
vote
1 answer

PHP sending very large multipart file to another webserver

I have written some code using streams that sends a file via a multiform post to another website. So this is php server code to -> another web server. I currently cannot use "curl", I constrained to streams. My concern (Comment below, Concern here,)…
MacWise
  • 520
  • 3
  • 13
1
vote
0 answers

PHP input stream filter memory usage

I am processing XML files read directly from a zip archive using a PHP zip stream. Occasionally these files contain large CDATA chunks that is not relevant for me, but make the SimpleXml processing to run out of memory. I thought implementing a…
svenax
  • 75
  • 1
  • 6
1
vote
2 answers

Can I use a namespaced class with stream_wrapper_register?

I have a class VarStream that I would like to register like stream_wrapper_register('var', 'VarStream'); Our classes are always namespaced, so I've tried stream_wrapper_register('var', '\OurSpace\VarStream'); with no luck. Can I use namespacing…
Mark Kasson
  • 1,600
  • 1
  • 15
  • 28
1
vote
1 answer

PHP fopen() and php://memory not working as expected (data-loss)

I am currently trying to integrate a Class that uses fopen() with a php://memory stream to capture Curl headers. There are invariably better ways to capture the Curl headers, but I am not with enough time to write my own class at this moment. The…
Mike
  • 1,968
  • 18
  • 35
1
vote
1 answer

Twitter bearer access token request behaves differently on two servers

I have to implement the oAuth2 bearer access token method for a twitter feed. I followed correctly the details on the twitter developper website but i keep getting "Unable to verify your credentials twitter"... If i copy my credentials over to my…
0
votes
1 answer

Is it possible to use glob pattern for matching zip contents?

I thought I conveniently could list any contents in a zip file using a glob pattern. But that didn't seem to work. Is there a way?
tim
  • 2,530
  • 3
  • 26
  • 45
0
votes
1 answer

how to put stream php://temp content to html

I got this from the API which is audio if I try it in postman. the problem is I don't know how to retrieve it and put it in audio in html. I try to put the php://temp in src in audio html but it not work. because I used guzzle I try to use…
Qube
  • 543
  • 3
  • 9
  • 23