Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 12055

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Advisory file locking</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.stream-flush.html">streamWrapper::stream_flush</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.stream-metadata.html">streamWrapper::stream_metadata</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="streamwrapper.stream-lock" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::stream_lock</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">streamWrapper::stream_lock</span> &mdash; <span class="dc-title">Advisory file locking</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.stream-lock-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>streamWrapper::stream_lock</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$operation</code></span>
   )</div>

  <p class="para rdfs-comment">
   This method is called in response to  <span class="function"><a href="function.flock.html" class="function">flock()</a></span>, when
    <span class="function"><a href="function.file-put-contents.html" class="function">file_put_contents()</a></span> (when <em><code class="parameter">flags</code></em>
   contains <strong><code>LOCK_EX</code></strong>),
    <span class="function"><a href="function.stream-set-blocking.html" class="function">stream_set_blocking()</a></span> and when closing the stream
   (<strong><code>LOCK_UN</code></strong>).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.stream-lock-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">operation</code></em></span>
     <dd>

      <p class="para">
       <em><code class="parameter">operation</code></em> is one of the following:
       <ul class="itemizedlist">
        <li class="listitem">
         <span class="simpara">
          <strong><code>LOCK_SH</code></strong> to acquire a shared lock (reader).
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>LOCK_EX</code></strong> to acquire an exclusive lock (writer).
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>LOCK_UN</code></strong> to release a lock (shared or exclusive).
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>LOCK_NB</code></strong> if you don&#039;t want
           <span class="function"><a href="function.flock.html" class="function">flock()</a></span> to block while locking.
          (not supported on Windows)
         </span>
        </li>
       </ul>
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.stream-lock-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-streamwrapper.stream-lock-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   Emits <strong><code>E_WARNING</code></strong> if call to this method fails (i.e. not implemented).
  </p>
 </div>

 



 <div class="refsect1 seealso" id="refsect1-streamwrapper.stream-lock-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.stream-set-blocking.html" class="function" rel="rdfs-seeAlso">stream_set_blocking()</a> - Set blocking/non-blocking mode on a stream</span></li>
    <li class="member"> <span class="function"><a href="function.flock.html" class="function" rel="rdfs-seeAlso">flock()</a> - Portable advisory file locking</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.stream-flush.html">streamWrapper::stream_flush</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.stream-metadata.html">streamWrapper::stream_metadata</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>