function.stream-wrapper-register.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 486 行 · 第 1/3 页

HTML
486
字号
   bytes available, return as many as are available.  If no   more data is available, return either <b><tt>FALSE</tt></b> or an   empty string.   You must also update the read/write position of the stream   by the number of bytes that were successfully read.  </p>  <div class="methodsynopsis dc-description">   <span class="type">int</span> <span class="methodname"><b><b>stream_write</b></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$data</tt></span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.fwrite.html" class="function">fwrite()</a>   calls on the stream.  You should store <i><tt class="parameter">data</tt></i>   into the underlying storage used by your stream.  If there is not   enough room, try to store as many bytes as possible.   You should return the number of bytes that were successfully   stored in the stream, or 0 if none could be stored.   You must also update the read/write position of the stream   by the number of bytes that were successfully written.  </p>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><b>stream_eof</b></b></span>    ( <span class="methodparam">void</span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.feof.html" class="function">feof()</a>   calls on the stream.  You should return <b><tt>TRUE</tt></b> if the read/write   position is at the end of the stream and if no more data is available   to be read, or <b><tt>FALSE</tt></b> otherwise.  </p>  <div class="methodsynopsis dc-description">   <span class="type">int</span> <span class="methodname"><b><b>stream_tell</b></b></span>    ( <span class="methodparam">void</span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.ftell.html" class="function">ftell()</a>   calls on the stream.  You should return the current read/write   position of the stream.  </p>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><b>stream_seek</b></b></span>    ( <span class="methodparam"><span class="type">int</span> <tt class="parameter">$offset</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$whence</tt></span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.fseek.html" class="function">fseek()</a>   calls on the stream.  You should update the read/write position   of the stream according to <i><tt class="parameter">offset</tt></i> and   <i><tt class="parameter">whence</tt></i>.  See <a href="function.fseek.html" class="function">fseek()</a>   for more information about these parameters.   Return <b><tt>TRUE</tt></b> if the position was updated, <b><tt>FALSE</tt></b> otherwise.  </p>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><b>stream_flush</b></b></span>    ( <span class="methodparam">void</span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.fflush.html" class="function">fflush()</a>   calls on the stream.  If you have cached data in your stream   but not yet stored it into the underlying storage, you should   do so now.   Return <b><tt>TRUE</tt></b> if the cached data was successfully stored (or   if there was no data to store), or <b><tt>FALSE</tt></b> if the data could   not be stored.  </p>  <div class="methodsynopsis dc-description">   <span class="type">array</span> <span class="methodname"><b><b>stream_stat</b></b></span>    ( <span class="methodparam">void</span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.fstat.html" class="function">fstat()</a>   calls on the stream and should return an array containing the same   values as appropriate for the stream.  </p>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><a href="function.unlink.html" class="function">unlink</a></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$path</tt></span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.unlink.html" class="function">unlink()</a>   calls on URL paths associated with the wrapper and should attempt   to delete the item specified by <i><tt class="parameter">path</tt></i>.   It should return <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure.   In order for the appropriate error message to be returned,   do not define this method if your wrapper does not support unlinking.  </p>  <blockquote><p><b class="note">Note</b>:    <span class="simpara">    Userspace wrapper unlink method is not supported prior to    PHP 5.0.0.   </span>  </p></blockquote>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><a href="function.rename.html" class="function">rename</a></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$path_from</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$path_to</tt></span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.rename.html" class="function">rename()</a>   calls on URL paths associated with the wrapper and should attempt   to rename the item specified by <i><tt class="parameter">path_from</tt></i>   to the specification given by <i><tt class="parameter">path_to</tt></i>.   It should return <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure.   In order for the appropriate error message to be returned,   do not define this method if your wrapper does not support renaming.  </p>  <blockquote><p><b class="note">Note</b>:    <span class="simpara">    Userspace wrapper rename method is not supported prior to    PHP 5.0.0.   </span>  </p></blockquote>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><a href="function.mkdir.html" class="function">mkdir</a></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$path</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$mode</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$options</tt></span>   )</div>  <p class="para rdfs-comment">   This method is called in response to <a href="function.mkdir.html" class="function">mkdir()</a>   calls on URL paths associated with the wrapper and should attempt   to create the directory specified by <i><tt class="parameter">path</tt></i>.   It should return <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure.   In order for the appropriate error message to be returned,   do not define this method if your wrapper does not support   creating directories.  Posible values for <i><tt class="parameter">options</tt></i>   include <b><tt>STREAM_REPORT_ERRORS</tt></b> and   <b><tt>STREAM_MKDIR_RECURSIVE</tt></b>.  </p>  <blockquote><p><b class="note">Note</b>:    <span class="simpara">    Userspace wrapper mkdir method is not supported prior to    PHP 5.0.0.   </span>  </p></blockquote>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?