<?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 => 'ja',
  ),
  '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' => 'ja',
    '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">
        <span class="function"><a href="function.parse-url.php" class="function">parse_url()</a></span> でこの URL が壊れることがあります。
        :// で区切った URL のみをサポートしていることに注意しましょう。
        : や :/ も技術的な面では妥当な 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">path</code> に対して
        <code class="parameter">mode</code> が有効かどうかの確認を忘れないようにしましょう。
       </p>
      </p></blockquote>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       ストリーム API が設定する追加のフラグ。次の値を OR で連結して指定します。
       <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); ?>