php-doc-en/reference/dba/functions/dba-open.xml

81 lines
2.9 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/dba.xml, last change in rev 1.2 -->
<refentry id="function.dba-open">
<refnamediv>
<refname>dba_open</refname>
<refpurpose>Open database</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource|false</type><methodname>dba_open</methodname>
<methodparam><type>string</type><parameter>path</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>handler</parameter></methodparam>
<methodparam choice="opt"><parameter>...</parameter></methodparam>
</methodsynopsis>
<para>
<function>dba_open</function> establishes a database instance for
<parameter>path</parameter> with <parameter>mode</parameter> using
<parameter>handler</parameter>.
</para>
<para>
<parameter>path</parameter> is commonly a regular path in your filesystem.
</para>
<para>
<parameter>mode</parameter> is "r" for read access, "w" for read/write
access to an already existing database, "c" for read/write access
and database creation if it doesn't currently exist, and "n" for
create, truncate and read/write access.
</para>
<para>
<parameter>handler</parameter> is the <link linkend="dba.requirements">name
of the handler</link> which shall be
used for accessing <parameter>path</parameter>. It is passed all optional
parameters given to <function>dba_open</function> and can act on behalf of
them.
</para>
<para>
<function>dba_open</function> returns a positive handle or &false;, in
the case the open is successful or fails, respectively.
</para>
<note>
<para>
There can only be one writer for one database file. When you use dba on
a webserver and more than one request requires write operations they can
only be done one after another. Unfortuanetly some of the external
libraries simply fail or ignore this when trying to open the database for
another write operation. In this case you must use semaphores to guard
against. See <link linkend="ref.sem">System V semaphore support</link>.
</para>
</note>
<para>
See also:
<function>dba_popen</function>
<function>dba_close</function>
</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
-->