<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.streamwrapper.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'streamwrapper.stream-open.php',
    1 => 'streamWrapper::stream_open',
    2 => 'Открывает файл или URL',
  ),
  'up' => 
  array (
    0 => 'class.streamwrapper.php',
    1 => 'streamWrapper',
  ),
  'prev' => 
  array (
    0 => 'streamwrapper.stream-metadata.php',
    1 => 'streamWrapper::stream_metadata',
  ),
  'next' => 
  array (
    0 => 'streamwrapper.stream-read.php',
    1 => 'streamWrapper::stream_read',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/stream/streamwrapper/stream-open.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="streamwrapper.stream-open" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::stream_open</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.2, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">streamWrapper::stream_open</span> &mdash; <span class="dc-title">Открывает файл или URL</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.stream-open-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>streamWrapper::stream_open</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$path</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$mode</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$options</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter reference">&$opened_path</code></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Этот метод вызывается сразу после инициализации обёртки (например,
   <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span> и <span class="function"><a href="function.file-get-contents.php" class="function">file_get_contents()</a></span>).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.stream-open-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">path</code></dt>
     <dd>
      <p class="para">
       Задаёт URL, который будет передан в вызывающую функцию.
      </p>
      <blockquote class="note"><p><strong class="note">Замечание</strong>: 
       <p class="para">
        URL можно разделить на части функцией <span class="function"><a href="function.parse-url.php" class="function">parse_url()</a></span>.
        URL должен быть отделен символами ://.
        Символы : и :/ пока работают, но дальнейшая поддержка не гарантируется.
       </p>
      </p></blockquote>
     </dd>
    
    
     <dt><code class="parameter">mode</code></dt>
     <dd>
      <p class="para">
       Режим открытия файла, аналогичен режимам для
       <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span>.
      </p>
      <blockquote class="note"><p><strong class="note">Замечание</strong>: 
       <p class="para">
        Не забывайте проверять, поддерживается ли режим
        <code class="parameter">mode</code> файлом
        <code class="parameter">path</code>.
       </p>
      </p></blockquote>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       Хранит дополнительные флаги, задаваемые API потоков. Может содержать одно
       или несколько значений, объединённых операцией ИЛИ. Значения приведены ниже.
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Флаг</th>
           <th>Описание</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><strong><code><a href="stream.constants.php#constant.stream-use-path">STREAM_USE_PATH</a></code></strong></td>
           <td>Если путь <code class="parameter">path</code> относительный, требуется
            искать ресурс, используя include_path.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="stream.constants.php#constant.stream-report-errors">STREAM_REPORT_ERRORS</a></code></strong></td>
           <td>Если этот флаг задан, Вы можете вызывать ошибки
            функцией <span class="function"><a href="function.trigger-error.php" class="function">trigger_error()</a></span> во время
            открытия потока. Если флаг не задан, ошибки вызывать нельзя.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">opened_path</code></dt>
     <dd>
      <p class="para">
       Если <code class="parameter">path</code> успешно открыт, и
       <strong><code><a href="stream.constants.php#constant.stream-use-path">STREAM_USE_PATH</a></code></strong> задана в <code class="parameter">options</code>,
       то в аргументе <code class="parameter">opened_path</code> необходимо сохранить
       полный путь к открытому файлу или ресурсу.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.stream-open-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Функция возвращает <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, если выполнилась успешно, или <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, если возникла ошибка.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-streamwrapper.stream-open-errors">
  <h3 class="title">Ошибки</h3>
  <p class="para">Вызывает ошибку уровня
<strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>, если вызов к этому методу не удался
(например, не реализован).</p>
 </div>





 <div class="refsect1 notes" id="refsect1-streamwrapper.stream-open-notes">
  <h3 class="title">Примечания</h3>
  <blockquote class="note"><p><strong class="note">Замечание</strong>: <p class="para">Свойство
<var class="varname">streamWrapper::$context</var>
будет обновлено, если корректный контекст был передан в вызываемую функцию.</p></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-streamwrapper.stream-open-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fopen.php" class="function" rel="rdfs-seeAlso">fopen()</a> - Открывает файл или URL-адрес</span></li>
    <li><span class="function"><a href="function.parse-url.php" class="function" rel="rdfs-seeAlso">parse_url()</a> - Разбирает URL-адрес и возвращает компоненты адреса</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>