Lines Matching refs:a

13 You may have noticed a shed-load of issock parameters flying around the PHP
15 special case sockets and files every time you need to work with a "user-level"
23 Streams use a php_stream* parameter just as ANSI stdio (fread etc.) use a
55 options is a combination of the following values:
59 REPORT_ERRORS - show errors in a standard format if something
64 to be copied (if needed) into a stream that can
72 If you need to open a specific stream, or convert standard resources into
73 streams there are a range of functions to do this defined in php_streams.h.
77 Convert a FILE * into a stream.
80 Open a FILE * with tmpfile() and convert into a stream.
84 Generate a temporary file name and open it.
89 Convert a socket into a stream.
93 Open a connection to a host and return a stream.
97 Open a UNIX domain socket.
104 to know that the streams API provides a standard way to do this:
115 If you want to read the contents of a stream into an allocated memory buffer,
129 can use this function to copy the contents into a new stream that can
155 as a resource! It will close the origstream on success, and this
156 can lead to a crash when the resource is later used/released.
158 NOTE: If you are opening a stream and need it to be seekable, use the
164 not a lock can be set on this stream. Typically you can only set locks on stdio streams.
168 What if your extension needs to access the FILE* of a user level file pointer?
169 You need to "cast" the stream into a FILE*, and this is how you do it:
187 PHP_STREAM_AS_STDIO - a stdio FILE*
188 PHP_STREAM_AS_FD - a generic file descriptor
189 PHP_STREAM_AS_SOCKETD - a socket descriptor
191 If you ask a socket stream for a FILE*, the abstraction will use fdopen to
195 If your system has the fopencookie function, php streams can synthesize a
211 to find out if a stream can be cast, without actually performing the cast, so
212 to check if a stream is a socket you might use:
215 /* it can be a socket */
219 stream_is tells you if the stream is a particular type of stream, whereas
227 There are two main structures associated with a stream - the php_stream
228 itself, which holds some state information (and possibly a buffer) and a
236 that can efficiently behave as fgets. The ops struct also contains a label
238 stdio implementation has a label of "STDIO" for example.
240 The idea is that a stream implementation defines a php_stream_ops struct, and
241 associates it with a php_stream using php_stream_alloc.
260 php_stream_stdio_ops is a php_stream_ops structure that can be used to handle
263 A socket based stream would use code similar to that above to create a stream
271 ops is a pointer to the implementation,
276 their own buffering - such a FILE*),
279 of a request (it uses pemalloc),
281 in the mode parameter, except that it checks for a 'w' in the string when
285 into a FILE*, so it should be compatible with the mode parameter of fopen().
299 RULE #2: Please use the stdio stream as a reference; it will help you
304 php_stream. For example, you might need a pointer to some memory for memory
305 based streams, or if you were making a stream to read data from an RDBMS like
308 The stream has a field called abstract that you can use to hold this data.
309 If you need to store more than a single field of data, define a structure to
322 /* initialize the connection, and run a query, using the fields in state to
355 such as coping with a buffer size too small to hold the data,
370 Take a look at the STDIO implementation in streams.c for more information