From 6e9cb9534657a39b0582aff9434f06061d412446 Mon Sep 17 00:00:00 2001
From: Esen Sagynov <cubrid@php.net>
Date: Sat, 19 Nov 2011 06:29:15 +0000
Subject: [PATCH] Added examples about query timeout; Added the new_link
 parameter in cubrid_connect and cubrid_connect_with_url to make it more
 compatibility with mysql

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@319539 c90b9560-bf6c-de11-be94-00142212c4b1
---
 .../functions/cubrid-connect-with-url.xml     | 18 ++++++---
 reference/cubrid/functions/cubrid-connect.xml | 18 ++++++---
 .../functions/cubrid-get-query-timeout.xml    | 38 +++++++++++++++++++
 3 files changed, 64 insertions(+), 10 deletions(-)

diff --git a/reference/cubrid/functions/cubrid-connect-with-url.xml b/reference/cubrid/functions/cubrid-connect-with-url.xml
index 314596a4e3..b8693125ae 100644
--- a/reference/cubrid/functions/cubrid-connect-with-url.xml
+++ b/reference/cubrid/functions/cubrid-connect-with-url.xml
@@ -14,6 +14,7 @@
    <methodparam><type>string</type><parameter>conn_url</parameter></methodparam>  
    <methodparam choice="opt"><type>string</type><parameter>userid</parameter></methodparam>  
    <methodparam choice="opt"><type>string</type><parameter>passwd</parameter></methodparam>  
+   <methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam>  
   </methodsynopsis>
   <para>
    The <function>cubrid_connect_with_url</function> function is used to
@@ -22,11 +23,7 @@
    enabled in CUBRID, you must specify the connection information of the
    standby server, which is used for failover when failure occurs, in the url
    string argument of this function. If the user name and password is not
-   given, then the "PUBLIC" connection will be made by default. If a second
-   call is made to <function>cubrid_connect</function> with the same
-   <parameter>conn_url</parameter>, and <parameter>userid</parameter> as an
-   existing connection, the existing connection will be returned unless you
-   pass.
+   given, then the "PUBLIC" connection will be made by default.
   </para>
   <para>
    &lt;url&gt; ::= CUBRID:&lt;host&gt;:&lt;db_name&gt;:&lt;db_user&gt;:&lt;db_password&gt;:[?&lt;properties&gt;]
@@ -68,6 +65,17 @@
      <term><parameter>passwd</parameter></term>
      <listitem><para>User password.</para></listitem>
     </varlistentry>
+    <varlistentry>
+     <term><parameter>new_link</parameter></term>
+     <listitem><para>If a second call is made to
+       <function>cubrid_connect_with_url</function> with the same arguments,
+       no new connection will be established, but instead, the connection
+       identifier of the already opened connection will be returned. The
+       <parameter>new_link</parameter> parameter modifies this behavior and
+       makes <function> cubrid_connect_with_url</function> always open a new
+       connection, even if <function> cubrid_connect_with_url</function> was
+       called before with the same parameters.</para></listitem>
+    </varlistentry>
    </variablelist>
   </para>
  </refsect1>
diff --git a/reference/cubrid/functions/cubrid-connect.xml b/reference/cubrid/functions/cubrid-connect.xml
index ef5c127610..ee29600935 100644
--- a/reference/cubrid/functions/cubrid-connect.xml
+++ b/reference/cubrid/functions/cubrid-connect.xml
@@ -16,17 +16,14 @@
    <methodparam><type>string</type><parameter>dbname</parameter></methodparam>  
    <methodparam choice="opt"><type>string</type><parameter>userid</parameter></methodparam>  
    <methodparam choice="opt"><type>string</type><parameter>passwd</parameter></methodparam>  
+   <methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam>  
   </methodsynopsis>
   <para>
     The <function>cubrid_connect</function> function is used to establish the
     environment for connecting to your server by using your server address,
     port number, database name, user name, and password. If the user name and
     password is not given, then the "PUBLIC" connection will be made by
-    default. If a second call is made to <function>cubrid_connect</function>
-    with the same <parameter>host</parameter>, <parameter>port</parameter>,
-    <parameter>dbname</parameter> and <parameter>userid</parameter> as an
-    existing connection, the existing connection will be returned unless you
-    pass.
+    default. 
   </para>
  </refsect1>
 
@@ -54,6 +51,17 @@
     <term><parameter>passwd</parameter></term>
     <listitem><para>User password.</para></listitem>
    </varlistentry>
+   <varlistentry>
+    <term><parameter>new_link</parameter></term>
+    <listitem><para>If a second call is made to
+      <function>cubrid_connect</function> with the same arguments, no new
+      connection will be established, but instead, the connection identifier
+      of the already opened connection will be returned. The
+      <parameter>new_link</parameter> parameter modifies this behavior and
+      makes <function>cubrid_connect</function> always open a new connection,
+      even if <function>cubrid_connect</function> was called before with the
+      same parameters.</para></listitem>
+   </varlistentry>
   </variablelist>
   </para>
  </refsect1>
diff --git a/reference/cubrid/functions/cubrid-get-query-timeout.xml b/reference/cubrid/functions/cubrid-get-query-timeout.xml
index e6ecf73bf8..ce68cf660c 100644
--- a/reference/cubrid/functions/cubrid-get-query-timeout.xml
+++ b/reference/cubrid/functions/cubrid-get-query-timeout.xml
@@ -41,6 +41,44 @@
   </para>
  </refsect1>
 
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <example>
+   <title><function>cubrid_get_query_timeout</function> example</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+
+$host = "localhost";
+$port = 33000;
+$db = "demodb";
+
+$conn =
+cubrid_connect_with_url("CUBRID:$host:$port:$db:::?&login_timeout=50000&query_timeout=5000&disconnect_on_query_timeout=yes");
+
+$req = cubrid_prepare($conn, "SELECT * FROM code");
+
+$timeout = cubrid_get_query_timeout($req);
+var_dump($timeout);
+
+cubrid_set_query_timeout($req, 1000);
+$timeout = cubrid_get_query_timeout($req);
+var_dump($timeout);
+
+cubrid_close($conn);
+?>
+]]>
+   </programlisting>
+    &example.outputs;
+    <screen>
+<![CDATA[
+int(5000)
+int(1000)
+]]>
+   </screen>
+  </example>
+ </refsect1>
+
  <refsect1 role="seealso">
   &reftitle.seealso;
   <para>