reference/oci8/functions/oci-pconnect.xml
5e41012cfdf8f2eff5fa56de446c7656afac536c
...
...
@@ -9,23 +9,23 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>resource</type><methodname>oci_pconnect</methodname>
12
+
<type class="union"><type>resource</type><type>false</type></type><methodname>oci_pconnect</methodname>
13
13
<methodparam><type>string</type><parameter>username</parameter></methodparam>
14
14
<methodparam><type>string</type><parameter>password</parameter></methodparam>
15
-
<methodparam choice="opt"><type>string</type><parameter>connection_string</parameter></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter>character_set</parameter></methodparam>
17
-
<methodparam choice="opt"><type>int</type><parameter>session_mode</parameter></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>connection_string</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>""</initializer></methodparam>
17
+
<methodparam choice="opt"><type>int</type><parameter>session_mode</parameter><initializer><constant>OCI_DEFAULT</constant></initializer></methodparam>
18
18
</methodsynopsis>
19
19
<para>
20
20
Creates a persistent connection to an Oracle server and logs on.
21
21
</para>
22
22
<para>
23
-
Persistent connections are cached and re-used between requests, resulting
24
-
in reduced overhead on each page load; a typical PHP application will have
25
-
a single persistent connection open against an Oracle server per Apache
26
-
child process (or PHP FastCGI/CGI process). See the <link
27
-
linkend="features.persistent-connections">Persistent Database
28
-
Connections</link> section for more information.
23
+
Persistent connections are cached and re-used between requests, resulting in
24
+
reduced overhead on each page load; a typical PHP application will have a
25
+
single persistent connection open against an Oracle server per Apache child
26
+
process (or PHP FPM process). See the <link linkend="oci8.connection">OCI8
27
+
Connection Handling and Connection Pooling</link> section for more
28
+
information.
29
29
</para>
30
30
</refsect1>
31
31

...
...
@@ -56,7 +56,7 @@
56
56
</listitem>
57
57
</varlistentry>
58
58
<varlistentry>
59
-
<term><parameter>character_set</parameter></term>
59
+
<term><parameter>encoding</parameter></term>
60
60
<listitem>
61
61
&oci.charset;
62
62
</listitem>
...
...
@@ -78,25 +78,56 @@
78
78
</para>
79
79
</refsect1>
80
80

81
+
<refsect1 role="examples">
82
+
&reftitle.examples;
83
+
<para>
84
+
<example>
85
+
<title>Basic <function>oci_pconnect</function> Example using Easy Connect syntax</title>
86
+
<programlisting role="php">
87
+
<![CDATA[
88
+
<?php
89
+

90
+
// Connects to the XE service (i.e. database) on the "localhost" machine
91
+
$conn = oci_pconnect('hr', 'welcome', 'localhost/XE');
92
+
if (!$conn) {
93
+
$e = oci_error();
94
+
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
95
+
}
96
+

97
+
$stid = oci_parse($conn, 'SELECT * FROM employees');
98
+
oci_execute($stid);
99
+

100
+
echo "<table border='1'>\n";
101
+
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
102
+
echo "<tr>\n";
103
+
foreach ($row as $item) {
104
+
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;") . "</td>\n";
105
+
}
106
+
echo "</tr>\n";
107
+
}
108
+
echo "</table>\n";
109
+

110
+
?>
111
+
]]>
112
+
</programlisting>
113
+
</example>
114
+
</para>
115
+
<para>
116
+
See <function>oci_connect</function> for further examples of parameter usage.
117
+
</para>
118
+
</refsect1>
119
+

81
120
<refsect1 role="notes">
82
121
&reftitle.notes;
83
122
<note>
84
123
<simpara>
85
-
Starting with PHP 5.1.2 and PECL oci8 1.1, the lifetime and
86
-
maximum number of persistent Oracle connections can be tuned by setting
87
-
the following configuration values: <link
88
-
linkend="ini.oci8.persistent-timeout">oci8.persistent_timeout</link>,
124
+
The lifetime and
125
+
maximum number of persistent Oracle connections per PHP process can be tuned by setting
126
+
the following configuration values: <link linkend="ini.oci8.persistent-timeout">oci8.persistent_timeout</link>,
89
127
<link linkend="ini.oci8.ping-interval">oci8.ping_interval</link> and
90
128
<link linkend="ini.oci8.max-persistent">oci8.max_persistent</link>.
91
129
</simpara>
92
130
</note>
93
-
<note>
94
-
<para>
95
-
In PHP versions before 5.0.0 you must
96
-
use <function>ociplogon</function> instead.
97
-
&oci.name.compat.note;
98
-
</para>
99
-
</note>
100
131
</refsect1>
101
132

102
133
<refsect1 role="seealso">
...
...
@@ -110,7 +141,6 @@
110
141
</refsect1>
111
142

112
143
</refentry>
113
-

114
144
<!-- Keep this comment at the end of the file
115
145
Local variables:
116
146
mode: sgml
117
147