php-doc-en/reference/stream/book.xml
Christoph M. Becker a3bb15df3f Remove interals2 book
The "Hacker's guide" is grossly outdated (it is about ZendEngine 2;
some stuff even about ZE1, although ZE4 is current), and nobody is
working on it for years.  Therefore we remove this part of the manual;
users are better off reading external resources, such as
<http://www.phpinternalsbook.com/>.

Closes GH-152.
2021-01-10 15:54:24 +01:00

91 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<book xml:id="book.stream" xmlns="http://docbook.org/ns/docbook">
<?phpdoc extension-membership="core" ?>
<title>Streams</title>
<preface xml:id="intro.stream">
&reftitle.intro;
<simpara>
Streams are
the way of generalizing file, network, data compression, and other
operations which share a common set of functions and uses. In
its simplest definition, a <literal>stream</literal> is a
<literal>resource</literal> object which exhibits streamable
behavior. That is, it can be read from or written to in a linear
fashion, and may be able to <function>fseek</function> to an
arbitrary location within the stream.
</simpara>
<simpara>
A <literal>wrapper</literal> is additional code which tells the stream how to handle
specific protocols/encodings. For example, the <literal>http</literal>
wrapper knows how to translate a URL into an <literal>HTTP/1.0</literal>
request for a file on a remote server. There are many wrappers
built into PHP by default (See <xref linkend="wrappers"/>),
and additional, custom wrappers may be added either within a
PHP script using <function>stream_wrapper_register</function>,
or directly from an extension.
Because any variety of wrapper may be added to PHP,
there is no set limit on what can be done with them. To access the list
of currently registered wrappers, use <function>stream_get_wrappers</function>.
</simpara>
<para>
A stream is referenced as: <parameter>scheme</parameter>://<parameter>target</parameter>
<itemizedlist>
<listitem>
<simpara>
<parameter>scheme</parameter>(string) -
The name of the wrapper to be used. Examples include: file,
http, https, ftp, ftps, compress.zlib, compress.bz2, and php. See
<xref linkend="wrappers"/> for a list of PHP built-in wrappers. If
no wrapper is specified, the function default is used (typically
<literal>file</literal>://).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>target</parameter> -
Depends on the wrapper used. For filesystem related streams this is
typically a path and filename of the desired file. For network related
streams this is typically a hostname, often with a path appended. Again, see
<xref linkend="wrappers"/> for a description of targets for built-in streams.
</simpara>
</listitem>
</itemizedlist>
</para>
</preface>
&reference.stream.setup;
&reference.stream.constants;
&reference.stream.filters;
&reference.stream.contexts;
&reference.stream.errors;
&reference.stream.examples;
&reference.stream.php-user-filter;
&reference.stream.streamwrapper;
&reference.stream.reference;
</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->