mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-29 11:43:08 +02:00
169 lines
5.1 KiB
XML
169 lines
5.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: ed6de1ae20ce16c0c7be0b3fef282b6065bebfac Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.oci-pconnect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>oci_pconnect</refname>
|
|
<refpurpose>Ouvre une connexion persistante à un serveur Oracle</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>resource</type><type>false</type></type><methodname>oci_pconnect</methodname>
|
|
<methodparam><type>string</type><parameter>username</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>password</parameter></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>connection_string</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>""</initializer></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>session_mode</parameter><initializer><constant>OCI_DEFAULT</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Ouvre une connexion persistante à un serveur Oracle et s'identifie.
|
|
</para>
|
|
<para>
|
|
Les connexions persistantes sont mises en cache et sont réutilisées
|
|
entre les requêtes, réduisant ainsi la charge à chaque chargement de la page ;
|
|
une application PHP typique a une seule connexion persistante à un serveur Oracle
|
|
par processus enfant Apache (ou processus PHP FastCGI/CGI). Voir la section sur la
|
|
<link linkend="oci8.connection">Gestion des Connexions et le Regroupement
|
|
des Connexions</link> pour plus d'informations.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>username</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le nom d'utilisateur Oracle.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>password</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le mot de passe de l'utilisateur.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>connection_string</parameter></term>
|
|
<listitem>
|
|
&oci.db;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding</parameter></term>
|
|
<listitem>
|
|
&oci.charset;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>session_mode</parameter></term>
|
|
<listitem>
|
|
&oci.sessionmode;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne un identifiant de connexion, ou &false; si une erreur survient.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>oci_pconnect</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// Connexin au service XE (i.e. base de données) sur la machine "localhost"
|
|
$conn = oci_pconnect('hr', 'welcome', 'localhost/XE');
|
|
if (!$conn) {
|
|
$e = oci_error();
|
|
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
|
|
}
|
|
|
|
$stid = oci_parse($conn, 'SELECT * FROM employees');
|
|
oci_execute($stid);
|
|
|
|
echo "<table border='1'>\n";
|
|
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
|
|
echo "<tr>\n";
|
|
foreach ($row as $item) {
|
|
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "") . "</td>\n";
|
|
}
|
|
echo "</tr>\n";
|
|
}
|
|
echo "</table>\n";
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Voir la fonction <function>oci_connect</function>pour plus d'exemples sur l'utilisation
|
|
de ce paramètre.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<simpara>
|
|
Depuis PHP 5.1.2 et PECL OCI8 1.1, la durée de vie ainsi que le nombre maximal
|
|
de connexions persistantes Oracle par processus PHP peuvent être affinés en
|
|
définissant les valeurs de configuration suivantes : <link
|
|
linkend="ini.oci8.persistent-timeout">oci8.persistent_timeout</link>,
|
|
<link linkend="ini.oci8.ping-interval">oci8.ping_interval</link> et
|
|
<link linkend="ini.oci8.max-persistent">oci8.max_persistent</link>.
|
|
</simpara>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>oci_connect</function></member>
|
|
<member><function>oci_new_connect</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
|
|
-->
|