Initial commit

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@277782 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Hannes Magnusson 2009-03-25 19:49:59 +00:00
parent f66fb15023
commit 5ba8902e48
2 changed files with 137 additions and 1 deletions

View file

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="streamwrapper.stream-lock" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>streamWrapper::stream_lock</refname>
<refpurpose>Advisory file locking</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>streamWrapper::stream_lock</methodname>
<methodparam><type>mode</type><parameter>operation</parameter></methodparam>
</methodsynopsis>
<para>
This method is called in response to <function>flock</function>, when
<function>file_put_contents</function> (when <parameter>flags</parameter>
contains <constant>LOCK_EX</constant>), and when closing the stream
(<constant>LOCK_UN</constant>).
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>operation</parameter></term>
<listitem>
<para>
<parameter>operation</parameter> is one of the following:
<itemizedlist>
<listitem>
<simpara>
<constant>LOCK_SH</constant> to acquire a shared lock (reader).
</simpara>
</listitem>
<listitem>
<simpara>
<constant>LOCK_EX</constant> to acquire an exclusive lock (writer).
</simpara>
</listitem>
<listitem>
<simpara>
<constant>LOCK_UN</constant> to release a lock (shared or exclusive).
</simpara>
</listitem>
<listitem>
<simpara>
<constant>LOCK_NB</constant> if you don't want
<function>flock</function> to block while locking.
(not supported on Windows)
</simpara>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="errors"><!-- {{{ -->
&reftitle.errors;
<para>
Emits <constant>E_WARNING</constant> if call to this method fails (i.e. not implemented).
</para>
</refsect1><!-- }}} -->
<!--
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>streamWrapper::stream_lock</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* ... */
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
...
]]>
</screen>
</example>
</para>
</refsect1>
-->
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>stream_set_blocking</function></member>
<member><function>stream_set_timeout</function></member>
<member><function>stream_set_write_buffer</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!--
Do NOT translate this file
-->
@ -61,6 +61,7 @@
<function name='streamwrapper::stream_close' from='PHP 4 &gt;= 4.3.2, PHP 5'/>
<function name='streamwrapper::stream_eof' from='PHP 4 &gt;= 4.3.2, PHP 5'/>
<function name='streamwrapper::stream_flush' from='PHP 4 &gt;= 4.3.2, PHP 5'/>
<function name='streamwrapper::stream_lock' from='PHP 5'/>
<function name='streamwrapper::stream_open' from='PHP 4 &gt;= 4.3.2, PHP 5'/>
<function name='streamwrapper::stream_read' from='PHP 4 &gt;= 4.3.2, PHP 5'/>
<function name='streamwrapper::stream_seek' from='PHP 4 &gt;= 4.3.2, PHP 5'/>