reference/sqlite3/sqlite3/construct.xml
61374bbe228e8e9c55a24aba59a1e2bb2a871148
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="sqlite3.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>SQLite3::__construct</refname>
...
...
@@ -11,12 +10,12 @@
11
10

12
11
<refsect1 role="description">
13
12
&reftitle.description;
14
-
<methodsynopsis>
13
+
<constructorsynopsis role="SQLite3">
15
14
<modifier>public</modifier> <methodname>SQLite3::__construct</methodname>
16
15
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
17
-
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
18
-
<methodparam choice="opt"><type>string</type><parameter>encryption_key</parameter></methodparam>
19
-
</methodsynopsis>
16
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE</initializer></methodparam>
17
+
<methodparam choice="opt"><type>string</type><parameter>encryptionKey</parameter><initializer>""</initializer></methodparam>
18
+
</constructorsynopsis>
20
19
<para>
21
20
Instantiates an SQLite3 object and opens a connection to an
22
21
SQLite 3 database. If the build includes encryption, then it will attempt
...
...
@@ -33,6 +32,9 @@
33
32
<listitem>
34
33
<para>
35
34
Path to the SQLite database, or <literal>:memory:</literal> to use in-memory database.
35
+
If <parameter>filename</parameter> is an empty string, then a private, temporary on-disk
36
+
database will be created. This private database will be automatically
37
+
deleted as soon as the database connection is closed.
36
38
</para>
37
39
</listitem>
38
40
</varlistentry>
...
...
@@ -45,19 +47,19 @@
45
47
<itemizedlist>
46
48
<listitem>
47
49
<para>
48
-
<literal>SQLITE3_OPEN_READONLY</literal>: Open the database for
50
+
<constant>SQLITE3_OPEN_READONLY</constant>: Open the database for
49
51
reading only.
50
52
</para>
51
53
</listitem>
52
54
<listitem>
53
55
<para>
54
-
<literal>SQLITE3_OPEN_READWRITE</literal>: Open the database for
56
+
<constant>SQLITE3_OPEN_READWRITE</constant>: Open the database for
55
57
reading and writing.
56
58
</para>
57
59
</listitem>
58
60
<listitem>
59
61
<para>
60
-
<literal>SQLITE3_OPEN_CREATE</literal>: Create the database if it
62
+
<constant>SQLITE3_OPEN_CREATE</constant>: Create the database if it
61
63
does not exist.
62
64
</para>
63
65
</listitem>
...
...
@@ -66,11 +68,12 @@
66
68
</listitem>
67
69
</varlistentry>
68
70
<varlistentry>
69
-
<term><parameter>encryption_key</parameter></term>
71
+
<term><parameter>encryptionKey</parameter></term>
70
72
<listitem>
71
73
<para>
72
74
An optional encryption key used when encrypting and decrypting an
73
-
SQLite database.
75
+
SQLite database. If the SQLite encryption module is not installed,
76
+
this parameter will have no effect.
74
77
</para>
75
78
</listitem>
76
79
</varlistentry>
...
...
@@ -79,13 +82,6 @@
79
82

80
83
</refsect1>
81
84

82
-
<refsect1 role="returnvalues">
83
-
&reftitle.returnvalues;
84
-
<para>
85
-
Returns an SQLite3 object on success.
86
-
</para>
87
-
</refsect1>
88
-

89
85
<refsect1 role="errors">
90
86
&reftitle.errors;
91
87
<para>
...
...
@@ -93,6 +89,29 @@
93
89
</para>
94
90
</refsect1>
95
91

92
+
<refsect1 role="changelog">
93
+
&reftitle.changelog;
94
+
<informaltable>
95
+
<tgroup cols="2">
96
+
<thead>
97
+
<row>
98
+
<entry>&Version;</entry>
99
+
<entry>&Description;</entry>
100
+
</row>
101
+
</thead>
102
+
<tbody>
103
+
<row>
104
+
<entry>7.0.10</entry>
105
+
<entry>
106
+
The <parameter>filename</parameter> can now be empty to use a private,
107
+
temporary on-disk database.
108
+
</entry>
109
+
</row>
110
+
</tbody>
111
+
</tgroup>
112
+
</informaltable>
113
+
</refsect1>
114
+

96
115
<refsect1 role="examples">
97
116
&reftitle.examples;
98
117
<para>
...
...
@@ -103,7 +122,7 @@
103
122
<?php
104
123
$db = new SQLite3('mysqlitedb.db');
105
124

106
-
$db->exec('CREATE TABLE foo (bar STRING)');
125
+
$db->exec('CREATE TABLE foo (bar TEXT)');
107
126
$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')");
108
127

109
128
$result = $db->query('SELECT bar FROM foo');
...
...
@@ -116,7 +135,6 @@ var_dump($result->fetchArray());
116
135
</refsect1>
117
136

118
137
</refentry>
119
-

120
138
<!-- Keep this comment at the end of the file
121
139
Local variables:
122
140
mode: sgml
123
141