<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.stream.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'intro.stream.php',
    1 => 'Вступ',
    2 => 'Вступ',
  ),
  'up' => 
  array (
    0 => 'book.stream.php',
    1 => 'Streams',
  ),
  'prev' => 
  array (
    0 => 'book.stream.php',
    1 => 'Streams',
  ),
  'next' => 
  array (
    0 => 'stream.setup.php',
    1 => 'Встановлення/налаштування',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/stream/book.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="intro.stream" class="preface">
   <h1 class="title">Вступ</h1>
   <p class="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 <code class="literal">stream</code> is a 
    <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> object which exhibits streamable
    behavior.  That is, it can be read from or written to in a linear 
    fashion, and may be able to <span class="function"><a href="function.fseek.php" class="function">fseek()</a></span> to an
    arbitrary location within the stream.
   </p>
   <p class="simpara">
    A <code class="literal">wrapper</code> is additional code which tells the stream how to handle
    specific protocols/encodings.  For example, the <code class="literal">http</code>
    wrapper knows how to translate a URL into an <code class="literal">HTTP/1.0</code>
    request for a file on a remote server.  There are many wrappers
    built into PHP by default (See <a href="wrappers.php" class="xref">Підтримувані протоколи та обгортки</a>),
    and additional, custom wrappers may be added either within a
    PHP script using <span class="function"><a href="function.stream-wrapper-register.php" class="function">stream_wrapper_register()</a></span>,
    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 <span class="function"><a href="function.stream-get-wrappers.php" class="function">stream_get_wrappers()</a></span>.
   </p>
   <p class="para">
    A stream is referenced as: <code class="parameter">scheme</code>://<code class="parameter">target</code>
    <ul class="itemizedlist">
     <li class="listitem">
      <span class="simpara">
       <code class="parameter">scheme</code> (string) -
       The name of the wrapper to be used.  Examples include: file, 
       http, https, ftp, ftps, compress.zlib, compress.bz2, and php.  See 
       <a href="wrappers.php" class="xref">Підтримувані протоколи та обгортки</a> for a list of PHP built-in wrappers.  If
       no wrapper is specified, the function default is used (typically
       <code class="literal">file</code>://).
      </span>
     </li>
     <li class="listitem">
      <span class="simpara">
       <code class="parameter">target</code> - 
       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
       <a href="wrappers.php" class="xref">Підтримувані протоколи та обгортки</a> for a description of targets for built-in streams.
      </span>
     </li>
    </ul>
   </p>
  </div><?php manual_footer($setup); ?>