Skip to content

Commit ebac7ea

Browse files
author
Yoshinari Takaoka
committed
Document SQLite3::backup()
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@350587 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent c20e0e5 commit ebac7ea

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

reference/sqlite3/sqlite3/backup.xml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 4aba1fc71aa5dccdd2fe5b619a5bd829eb9570ec Maintainer: mumumu Status: ready -->
4+
5+
<refentry xml:id="sqlite3.backup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>SQLite3::backup</refname>
8+
<refpurpose>あるデータベースを、別のデータベースにバックアップする</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<methodsynopsis>
14+
<modifier>public</modifier> <type>bool</type><methodname>SQLite3::backup</methodname>
15+
<methodparam><type>SQLite3</type><parameter>destination_db</parameter></methodparam>
16+
<methodparam choice="opt"><type>string</type><parameter>source_dbname</parameter><initializer>"main"</initializer></methodparam>
17+
<methodparam choice="opt"><type>string</type><parameter>destination_dbname</parameter><initializer>"main"</initializer></methodparam>
18+
</methodsynopsis>
19+
<para>
20+
<methodname>SQLite3::backup</methodname> は、あるデータベースの内容を別のデータベースにコピーし、
21+
コピー先のデータベースの内容を上書きします。
22+
このメソッドは、データベースのバックアップを作成したり、
23+
インメモリのデータベースを永続的なファイルにコピーしたり、その逆を行う場合に便利です。
24+
</para>
25+
</refsect1>
26+
27+
<refsect1 role="parameters">
28+
&reftitle.parameters;
29+
<variablelist>
30+
<varlistentry>
31+
<term><parameter>destination_db</parameter></term>
32+
<listitem>
33+
<para>
34+
<methodname>SQLite3::open</methodname> でオープンされたデータベース接続
35+
</para>
36+
</listitem>
37+
</varlistentry>
38+
<varlistentry>
39+
<term><parameter>source_dbname</parameter></term>
40+
<listitem>
41+
<para>
42+
メインデータベースの場合、データベース名は <literal>"main"</literal> です。
43+
一時的なデータベースの場合は、<literal>"temp"</literal> になります。
44+
また、<literal>ATTACH</literal> 文の <literal>AS</literal> キーワードの後に指定された名前が使えます。
45+
</para>
46+
</listitem>
47+
</varlistentry>
48+
<varlistentry>
49+
<term><parameter>destination_dbname</parameter></term>
50+
<listitem>
51+
<para>
52+
<parameter>source_dbname</parameter> に似ていますが、
53+
コピー先のデータベースを表します。
54+
</para>
55+
</listitem>
56+
</varlistentry>
57+
</variablelist>
58+
</refsect1>
59+
60+
<refsect1 role="returnvalues">
61+
&reftitle.returnvalues;
62+
<para>
63+
&return.success;
64+
</para>
65+
</refsect1>
66+
67+
<refsect1 role="examples">
68+
&reftitle.examples;
69+
<example xml:id="function-name.example.basic">
70+
<title>既存のデータベースをバックアップする</title>
71+
<programlisting role="php">
72+
<![CDATA[
73+
<?php
74+
// $conn は、既にオープンされた sqlite3 データベースへの接続です。
75+
76+
$backup = new SQLite3('backup.sqlite');
77+
$conn->backup($backup);
78+
?>
79+
]]>
80+
</programlisting>
81+
</example>
82+
</refsect1>
83+
84+
</refentry>
85+
86+
<!-- Keep this comment at the end of the file
87+
Local variables:
88+
mode: sgml
89+
sgml-omittag:t
90+
sgml-shorttag:t
91+
sgml-minimize-attributes:nil
92+
sgml-always-quote-attributes:t
93+
sgml-indent-step:1
94+
sgml-indent-data:t
95+
indent-tabs-mode:nil
96+
sgml-parent-document:nil
97+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
98+
sgml-exposed-tags:nil
99+
sgml-local-catalogs:nil
100+
sgml-local-ecat-files:nil
101+
End:
102+
vim600: syn=xml fen fdm=syntax fdl=2 si
103+
vim: et tw=78 syn=sgml
104+
vi: ts=1 sw=1
105+
-->

0 commit comments

Comments
 (0)