mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Refactor more information from stream_wrapper_register to the method
prototypes - Refactor the example from stream_wrapper_register to the examples chapter - Refactored the changelog from stream_wrapper_register to the class prototype - Added an example for stream_wrapper_register - Added a seealso for stream_wrapper_register - Added versioninfo git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@277771 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
46c8079147
commit
1477e2e71f
9 changed files with 337 additions and 272 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<chapter xml:id="stream.examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -92,6 +92,134 @@ fclose($fp);
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<section xml:id='stream.streamwrapper.example-1'>
|
||||
<title>Example class registered as stream wrapper</title>
|
||||
<para>
|
||||
The example below implements a var:// protocol handler that allows
|
||||
read/write access to a named global variable using standard filesystem
|
||||
stream functions such as <function>fread</function>. The var:// protocol
|
||||
implemented below, given the URL "var://foo" will read/write data
|
||||
to/from $GLOBALS["foo"].
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>A Stream for reading/writing global variables</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
class VariableStream {
|
||||
var $position;
|
||||
var $varname;
|
||||
|
||||
function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
$url = parse_url($path);
|
||||
$this->varname = $url["host"];
|
||||
$this->position = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function stream_read($count)
|
||||
{
|
||||
$ret = substr($GLOBALS[$this->varname], $this->position, $count);
|
||||
$this->position += strlen($ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function stream_write($data)
|
||||
{
|
||||
$left = substr($GLOBALS[$this->varname], 0, $this->position);
|
||||
$right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
|
||||
$GLOBALS[$this->varname] = $left . $data . $right;
|
||||
$this->position += strlen($data);
|
||||
return strlen($data);
|
||||
}
|
||||
|
||||
function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
function stream_eof()
|
||||
{
|
||||
return $this->position >= strlen($GLOBALS[$this->varname]);
|
||||
}
|
||||
|
||||
function stream_seek($offset, $whence)
|
||||
{
|
||||
switch ($whence) {
|
||||
case SEEK_SET:
|
||||
if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) {
|
||||
$this->position = $offset;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case SEEK_CUR:
|
||||
if ($offset >= 0) {
|
||||
$this->position += $offset;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case SEEK_END:
|
||||
if (strlen($GLOBALS[$this->varname]) + $offset >= 0) {
|
||||
$this->position = strlen($GLOBALS[$this->varname]) + $offset;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stream_wrapper_register("var", "VariableStream")
|
||||
or die("Failed to register protocol");
|
||||
|
||||
$myvar = "";
|
||||
|
||||
$fp = fopen("var://myvar", "r+");
|
||||
|
||||
fwrite($fp, "line1\n");
|
||||
fwrite($fp, "line2\n");
|
||||
fwrite($fp, "line3\n");
|
||||
|
||||
rewind($fp);
|
||||
while (!feof($fp)) {
|
||||
echo fgets($fp);
|
||||
}
|
||||
fclose($fp);
|
||||
var_dump($myvar);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
line1
|
||||
line2
|
||||
line3
|
||||
string(18) "line1
|
||||
line2
|
||||
line3
|
||||
"
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.20 $ -->
|
||||
<!-- $Revision: 1.21 $ -->
|
||||
<refentry xml:id="function.stream-wrapper-register" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>stream_wrapper_register</refname>
|
||||
|
@ -35,98 +35,7 @@
|
|||
<term><parameter>classname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
To implement a wrapper, you need to define a class with a number of
|
||||
member functions, as defined below. When someone fopens your stream,
|
||||
PHP will create an instance of <parameter>classname</parameter> and
|
||||
then call methods on that instance. You must implement the methods
|
||||
exactly as described below - doing otherwise will lead to undefined
|
||||
behaviour.
|
||||
</para>
|
||||
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>stream_read</methodname>
|
||||
<methodparam><type>int</type><parameter>count</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This method is called in response to <function>fread</function>
|
||||
and <function>fgets</function> calls on the stream. You
|
||||
must return up-to <parameter>count</parameter> bytes of data
|
||||
from the current read/write position as a string.
|
||||
If there are less than <parameter>count</parameter>
|
||||
bytes available, return as many as are available. If no
|
||||
more data is available, return either &false; or an
|
||||
empty string.
|
||||
You must also update the read/write position of the stream
|
||||
by the number of bytes that were successfully read.
|
||||
</para>
|
||||
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>stream_write</methodname>
|
||||
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This method is called in response to <function>fwrite</function>
|
||||
calls on the stream. You should store <parameter>data</parameter>
|
||||
into the underlying storage used by your stream. If there is not
|
||||
enough room, try to store as many bytes as possible.
|
||||
You should return the number of bytes that were successfully
|
||||
stored in the stream, or 0 if none could be stored.
|
||||
You must also update the read/write position of the stream
|
||||
by the number of bytes that were successfully written.
|
||||
</para>
|
||||
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>stream_tell</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This method is called in response to <function>ftell</function>
|
||||
calls on the stream. You should return the current read/write
|
||||
position of the stream.
|
||||
</para>
|
||||
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>stream_seek</methodname>
|
||||
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>whence</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This method is called in response to <function>fseek</function>
|
||||
calls on the stream. You should update the read/write position
|
||||
of the stream according to <parameter>offset</parameter> and
|
||||
<parameter>whence</parameter>. See <function>fseek</function>
|
||||
for more information about these parameters.
|
||||
Return &true; if the position was updated, &false; otherwise.
|
||||
</para>
|
||||
|
||||
<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.
|
||||
The classname which implements the <parameter>protocol</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -145,136 +54,19 @@
|
|||
</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.3.0</entry>
|
||||
<entry>
|
||||
Added the following userspace wrappers: stream_set_option, stream_cast.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.0.0</entry>
|
||||
<entry>
|
||||
Added the following userspace wrappers: rmdir, mkdir, rename, unlink.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.0.0</entry>
|
||||
<entry>
|
||||
Added the <literal>context</literal> property.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="examples"><!-- {{{ -->
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A Stream for reading/writing global variables</title>
|
||||
<para>
|
||||
The example below implements a var:// protocol handler that allows
|
||||
read/write access to a named global variable using standard filesystem
|
||||
stream functions such as <function>fread</function>. The var:// protocol
|
||||
implemented below, given the URL "var://foo" will read/write data
|
||||
to/from $GLOBALS["foo"].
|
||||
</para>
|
||||
<title>How to register a stream wrapper</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
class VariableStream {
|
||||
var $position;
|
||||
var $varname;
|
||||
|
||||
function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
$url = parse_url($path);
|
||||
$this->varname = $url["host"];
|
||||
$this->position = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function stream_read($count)
|
||||
{
|
||||
$ret = substr($GLOBALS[$this->varname], $this->position, $count);
|
||||
$this->position += strlen($ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function stream_write($data)
|
||||
{
|
||||
$left = substr($GLOBALS[$this->varname], 0, $this->position);
|
||||
$right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
|
||||
$GLOBALS[$this->varname] = $left . $data . $right;
|
||||
$this->position += strlen($data);
|
||||
return strlen($data);
|
||||
}
|
||||
|
||||
function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
function stream_eof()
|
||||
{
|
||||
return $this->position >= strlen($GLOBALS[$this->varname]);
|
||||
}
|
||||
|
||||
function stream_seek($offset, $whence)
|
||||
{
|
||||
switch ($whence) {
|
||||
case SEEK_SET:
|
||||
if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) {
|
||||
$this->position = $offset;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case SEEK_CUR:
|
||||
if ($offset >= 0) {
|
||||
$this->position += $offset;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case SEEK_END:
|
||||
if (strlen($GLOBALS[$this->varname]) + $offset >= 0) {
|
||||
$this->position = strlen($GLOBALS[$this->varname]) + $offset;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$existed = in_array("var", stream_get_wrappers());
|
||||
if ($existed) {
|
||||
stream_wrapper_unregister("var");
|
||||
}
|
||||
|
||||
stream_wrapper_register("var", "VariableStream")
|
||||
or die("Failed to register protocol");
|
||||
|
||||
stream_wrapper_register("var", "VariableStream");
|
||||
$myvar = "";
|
||||
|
||||
$fp = fopen("var://myvar", "r+");
|
||||
|
@ -290,14 +82,43 @@ while (!feof($fp)) {
|
|||
fclose($fp);
|
||||
var_dump($myvar);
|
||||
|
||||
if ($existed) {
|
||||
stream_wrapper_restore("var");
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
line1
|
||||
line2
|
||||
line3
|
||||
string(18) "line1
|
||||
line2
|
||||
line3
|
||||
"
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="seealso"><!-- {{{ -->
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member>The <xref linkend="class.streamwrapper" /> prototype class</member>
|
||||
<member><xref linkend="stream.streamwrapper.example-1" /></member>
|
||||
<member><function>stream_wrapper_unregister</function></member>
|
||||
<member><function>stream_wrapper_restore</function></member>
|
||||
<member><function>stream_get_wrappers</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.streamwrapper" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
|
@ -22,6 +22,16 @@
|
|||
a class defining its own protocol should be.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
Implementing the methods in otherways then described here can lead to
|
||||
undefed behaviour.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
An instance of this class is initialized as soon as a stream function
|
||||
tries to access the protocol it is associated with.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
@ -87,6 +97,43 @@
|
|||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section 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 the <literal>context</literal> property.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</section><!-- }}} -->
|
||||
|
||||
<refsect1 role="seealso"><!-- {{{ -->
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><xref linkend="stream.streamwrapper.example-1" /></member>
|
||||
<member><function>stream_wrapper_register</function></member>
|
||||
<member><function>stream_wrapper_unregister</function></member>
|
||||
<member><function>stream_wrapper_restore</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
|
||||
|
||||
</partintro>
|
||||
|
||||
|
|
|
@ -1,23 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="streamwrapper.stream-read" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>streamWrapper::stream_read</refname>
|
||||
<refpurpose>The stream_read purpose</refpurpose>
|
||||
<refpurpose>Read from stream</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>streamWrapper::stream_read</methodname>
|
||||
<methodparam><type>string</type><parameter>count</parameter></methodparam>
|
||||
<modifier>public</modifier> <type>string</type><methodname>streamWrapper::stream_read</methodname>
|
||||
<methodparam><type>int</type><parameter>count</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The method description goes here.
|
||||
This method is called in response to <function>fread</function>
|
||||
and <function>fgets</function>.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
<note>
|
||||
<para>
|
||||
Remember to update the read/write position of the stream (by the number of
|
||||
bytes that were successfully read).
|
||||
</para>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
|
||||
|
@ -29,7 +34,7 @@
|
|||
<term><parameter>count</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Description...
|
||||
How many bytes of data from the current position should be returned.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -40,10 +45,14 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Description...
|
||||
If there are less than <parameter>count</parameter>
|
||||
bytes available, return as many as are available. If no
|
||||
more data is available, return either &false; or an
|
||||
empty string.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<!--
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -65,12 +74,14 @@
|
|||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
-->
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>Classname::Method</methodname></member>
|
||||
<member><function>fread</function></member>
|
||||
<member><function>fgets</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="streamwrapper.stream-seek" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -10,16 +10,17 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>streamWrapper::stream_seek</methodname>
|
||||
<methodparam><type>string</type><parameter>offset</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>whence</parameter></methodparam>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>streamWrapper::stream_seek</methodname>
|
||||
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>whence</parameter> <initializer>SEEK_SET</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The method description goes here.
|
||||
This method is called in response to <function>fseek</function>.
|
||||
</para>
|
||||
<para>
|
||||
The read/write position of the stream should be updated according to the
|
||||
<parameter>offset</parameter> and <parameter>whence</parameter>.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -30,7 +31,7 @@
|
|||
<term><parameter>offset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Description...
|
||||
The stream offset to seek to.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -38,7 +39,12 @@
|
|||
<term><parameter>whence</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Description...
|
||||
Possible values:
|
||||
<simplelist>
|
||||
<member><constant>SEEK_SET</constant> - Set position equal to <parameter>offset</parameter> bytes.</member>
|
||||
<member><constant>SEEK_CUR</constant> - Set position to current location plus <parameter>offset</parameter>.</member>
|
||||
<member><constant>SEEK_END</constant> - Set position to end-of-file plus <parameter>offset</parameter>.</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -49,10 +55,11 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Description...
|
||||
Return &true; if the position was updated, &false; otherwise.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<!--
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -74,12 +81,13 @@
|
|||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
-->
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>Classname::Method</methodname></member>
|
||||
<member><function>fseek</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="streamwrapper.stream-set-option" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -10,17 +10,14 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>streamWrapper::stream_set_option</methodname>
|
||||
<methodparam><type>string</type><parameter>option</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>arg1</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>arg2</parameter></methodparam>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>streamWrapper::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>
|
||||
The method description goes here.
|
||||
This method is called to set options on the stream.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -31,7 +28,12 @@
|
|||
<term><parameter>option</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Description...
|
||||
One of:
|
||||
<simplelist>
|
||||
<member><constant>STREAM_OPTION_BLOCKING</constant> (The method was called in response to <function>stream_set_blocking</function>)</member>
|
||||
<member><constant>STREAM_OPTION_READ_TIMEOUT</constant> (The method was called in response to <function>stream_set_timeout</function>)</member>
|
||||
<member><constant>STREAM_OPTION_WRITE_BUFFER</constant> (The method was called in response to <function>stream_set_write_buffer</function>)</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -39,7 +41,12 @@
|
|||
<term><parameter>arg1</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Description...
|
||||
If <parameter>option</parameter> is
|
||||
<simplelist>
|
||||
<member><constant>STREAM_OPTION_BLOCKING</constant>: requested blocking mode (1 meaning block 0 not blocking).</member>
|
||||
<member><constant>STREAM_OPTION_READ_TIMEOUT</constant>: the timeout in seconds.</member>
|
||||
<member><constant>STREAM_OPTION_WRITE_BUFFER</constant>: buffer mode (<constant>STREAM_BUFFER_NONE</constant> or <constant>STREAM_BUFFER_FULL</constant>).</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -47,7 +54,12 @@
|
|||
<term><parameter>arg2</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Description...
|
||||
If <parameter>option</parameter> is
|
||||
<simplelist>
|
||||
<member><constant>STREAM_OPTION_BLOCKING</constant>: This option is not set.</member>
|
||||
<member><constant>STREAM_OPTION_READ_TIMEOUT</constant>: the timeout in microseconds.</member>
|
||||
<member><constant>STREAM_OPTION_WRITE_BUFFER</constant>: the requested buffer size.</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -58,10 +70,13 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Description...
|
||||
&return.success;
|
||||
If <parameter>option</parameter> is not implemented, &false; should be
|
||||
returned.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<!--
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -83,12 +98,15 @@
|
|||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
-->
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>Classname::Method</methodname></member>
|
||||
<member><function>stream_set_blocking</function></member>
|
||||
<member><function>stream_set_timeout</function></member>
|
||||
<member><function>stream_set_write_buffer</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="streamwrapper.stream-tell" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -10,15 +10,12 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>streamWrapper::stream_tell</methodname>
|
||||
<modifier>public</modifier> <type>int</type><methodname>streamWrapper::stream_tell</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The method description goes here.
|
||||
This method is called in response to <function>ftell</function>.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -29,10 +26,11 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Description...
|
||||
Should return the curren position of the stream.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<!--
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -54,12 +52,13 @@
|
|||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
-->
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>Classname::Method</methodname></member>
|
||||
<member><function>ftell</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="streamwrapper.stream-write" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -10,15 +10,18 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>streamWrapper::stream_write</methodname>
|
||||
<modifier>public</modifier> <type>int</type><methodname>streamWrapper::stream_write</methodname>
|
||||
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The method description goes here.
|
||||
This method is called in response to <function>fwrite</function>.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
<note>
|
||||
<para>
|
||||
Remember to update the current position of the stream by number of bytes
|
||||
that were successfully written.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -29,8 +32,14 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Description...
|
||||
Should be stored into the underlying stream.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
If there is not enough room in the underlying stream, store as much as
|
||||
possible.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
@ -40,10 +49,12 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Description...
|
||||
Should return the number of bytes that were successfully stored, or 0 if
|
||||
none could be stored.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<!--
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -65,12 +76,13 @@
|
|||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
-->
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>Classname::Method</methodname></member>
|
||||
<member><function>fwrite</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!--
|
||||
Do NOT translate this file
|
||||
-->
|
||||
|
@ -48,6 +48,27 @@
|
|||
<function name='stream_wrapper_register' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='stream_wrapper_restore' from='PHP 5 >= 5.1.0'/>
|
||||
<function name='stream_wrapper_unregister' from='PHP 5 >= 5.1.0'/>
|
||||
|
||||
<function name='streamwrapper::dir_closedir' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::dir_opendir' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::dir_readdir' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::dir_rewinddir' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::mkdir' from='PHP 5'/>
|
||||
<function name='streamwrapper::rename' from='PHP 5'/>
|
||||
<function name='streamwrapper::rmdir' from='PHP 5'/>
|
||||
<function name='streamwrapper::stream_cast' from='PHP 5 >= 5.3.0'/>
|
||||
<function name='streamwrapper::stream_close' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_eof' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_flush' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_open' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_read' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_seek' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_set_option' from='PHP 5 >= 5.3.0'/>
|
||||
<function name='streamwrapper::stream_stat' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_tell' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::stream_write' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
<function name='streamwrapper::unlink' from='PHP 5'/>
|
||||
<function name='streamwrapper::url_stat' from='PHP 4 >= 4.3.2, PHP 5'/>
|
||||
</versions>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
Loading…
Reference in a new issue