1
0
mirror of https://github.com/php/doc-ru.git synced 2026-04-26 08:48:12 +02:00
Files
2024-09-26 09:12:56 +03:00

146 lines
4.4 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 0545e305cf06937b14b3f0694d6e716c9881ffd7 Maintainer: aur Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.dbase-open" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>dbase_open</refname>
<refpurpose>Открывает базу данных</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>resource</type><type>false</type></type><methodname>dbase_open</methodname>
<methodparam><type>string</type><parameter>path</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
Функция <function>dbase_open</function> открывает базу данных dBase в заданном
режиме доступа.
</para>
&note.open-basedir.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>path</parameter></term>
<listitem>
<para>
Путь к базе данных. Параметр принимает относительный или абсолютный путь к файлу,
в котором БД dBase сохранит данные.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Целое число, которое соответствует аналогичному значению в системном вызове <command>open()</command>.
Обычно 0 означает режим чтения, 1 — режим записи,
а 2 — режим чтения и записи.
</para>
<note>
<para>
Невозможно открыть файл базы данных dBase в режиме только для записи,
поскольку тогда функция не считает информацию из заголовка БД. Поэтому
нельзя указывать 1 как значение режима <parameter>mode</parameter>.
</para>
</note>
<para>
С dbase 7.0.0 режим <parameter>mode</parameter> устанавливают
константами <constant>DBASE_RDONLY</constant>
и <constant>DBASE_RDWR</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
В случае успешного выполнения функция возвращает ресурс базы данных&return.falseforfailure;.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>PECL-модуль dbase 7.0.0</entry>
<entry>
Параметр <parameter>database</parameter> теперь принимает аргумент
с типом <type>resource</type>, а не <type>int</type>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример открытия файла базы данных dBase</title>
<programlisting role="php">
<![CDATA[
<?php
// Открываем БД в режиме чтения
$db = dbase_open('/tmp/test.dbf', 0);
if ($db) {
// Считываем данные
dbase_close($db);
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>dbase_create</function></member>
<member><function>dbase_close</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:"~/.phpdoc/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
-->