Documented new user-space stream wrapper methods

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@269048 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Arnaud Le Blanc 2008-11-15 13:45:31 +00:00
parent 868905f20b
commit 19aea2c2b9

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<refentry xml:id="function.stream-wrapper-register" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>stream_wrapper_register</refname>
@ -204,6 +204,64 @@
calls on the stream and should return an array containing the same
values as appropriate for the stream.
</para>
<methodsynopsis>
<type>resource</type><methodname>stream_cast</methodname>
<methodparam><type>int</type><parameter>cast_as</parameter></methodparam>
</methodsynopsis>
<para>
This method is called in response to <function>stream_select</function>
calls on the stream and should return the underlying stream resource used
by the wrapper, or &false;. The
<parameter>cast_as</parameter> parameter can be
<constant>STREAM_CAST_FOR_SELECT</constant> when
<function>stream_select</function> is calling
<function>stream_cast</function> or
<constant>STREAM_CAST_AS_STREAM</constant> when
<function>stream_cast</function> is called for other uses.
</para>
<note>
<simpara>
Userspace wrapper stream_cast method is not supported prior to
PHP 5.3.0.
</simpara>
</note>
<methodsynopsis>
<type>bool</type><methodname>stream_set_option</methodname>
<methodparam><type>int</type><parameter>option</parameter></methodparam>
<methodparam><type>int</type><parameter>arg1</parameter></methodparam>
<methodparam><type>int</type><parameter>arg2</parameter></methodparam>
</methodsynopsis>
<para>
This method is called to set options on the stream. Possible values
for <parameter>option</parameter> are:
<simplelist>
<member><constant>STREAM_OPTION_BLOCKING</constant>: The method is called
in response to <function>stream_set_blocking</function>.
<parameter>arg1</parameter> is the requested blocking mode.</member>
<member><constant>STREAM_OPTION_READ_TIMEOUT</constant>: The method is
called in response to <function>stream_set_timeout</function>.
<parameter>arg1</parameter> is the timeout in seconds, and
<parameter>arg2</parameter> is the timeout in microseconds.</member>
<member><constant>STREAM_OPTION_WRITE_BUFFER</constant>: The method is
called in response to <function>stream_set_write_buffer</function>.
<parameter>arg1</parameter> is the buffer mode
(<constant>STREAM_BUFFER_NONE</constant> or
<constant>STREAM_BUFFER_FULL</constant>) and <parameter>arg2</parameter>
is the requested buffer size.</member>
</simplelist>
</para>
<para>
<function>stream_set_option</function> should return &false; on failure or
if the <parameter>option</parameter> is not implemented, &true; otherwise.
</para>
<note>
<simpara>
Userspace wrapper stream_set_option method is not supported prior to
PHP 5.3.0.
</simpara>
</note>
<methodsynopsis>
<type>bool</type><methodname>unlink</methodname>
@ -500,6 +558,38 @@ var_dump($myvar);
</para>
</refsect1>
<refsect1 role="changelog"><!-- {{{ -->
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.0.0</entry>
<entry>
Added <function>unlink</function>, <function>rename</function>,
<function>mkdir</function> and <function>rmdir</function> methods.
</entry>
</row>
<row>
<entry>5.3.0</entry>
<entry>
Added <function>stream_cast</function> and <function>stream_set_option</function> methods.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1><!-- }}} -->
</refentry>