File: book.xml

package info (click to toggle)
php-doc 20100521-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 59,992 kB
  • ctags: 4,085
  • sloc: xml: 796,833; php: 21,338; cpp: 500; sh: 117; makefile: 58; awk: 28
file content (99 lines) | stat: -rw-r--r-- 3,626 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<!-- Purpose: remote.other -->
<!-- Membership: core -->

<book xml:id="book.stream" xmlns="http://docbook.org/ns/docbook">
 <title>Streams</title>

  <preface xml:id="intro.stream">
   &reftitle.intro;
   <simpara>
    Streams were introduced with PHP 4.3.0 as
    a 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 locations 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 using the API Reference in <xref linkend="internals2.streams"/>.
    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>
   <para>
    <note>
     <para>
      Information on using streams within the PHP source code can be found in the
      <link linkend="internals2.ze1.streams">Streams API for PHP Extension Authors reference</link>.
     </para>
    </note>
   </para>
  </preface>

 &reference.stream.setup;
 &reference.stream.constants;
 &reference.stream.filters;
 &reference.stream.contexts;
 &reference.stream.errors;
 &reference.stream.examples;
 &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
-->