Hi Jakub:

Thanks for taking care of the undocumented methods.

The reformatted sample for  PDO::getAttribute() is much shorter, but
I'm a little concerned that it won't be as easy for users to
understand as my original examples were.

Dan

On 11/2/05, Jakub Vrana <[EMAIL PROTECTED]> wrote:
> vrana           Wed Nov  2 04:47:17 2005 EDT
>
>   Modified files:
>     /phpdoc/en/reference/pdo/functions  PDO-getAttribute.xml
>                                         PDO-setAttribute.xml
>                                         PDOStatement-getAttribute.xml
>                                         PDOStatement-setAttribute.xml
>   Log:
>   Attributes
>
> http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/functions/PDO-getAttribute.xml?r1=1.7&r2=1.8&ty=u
> Index: phpdoc/en/reference/pdo/functions/PDO-getAttribute.xml
> diff -u phpdoc/en/reference/pdo/functions/PDO-getAttribute.xml:1.7 
> phpdoc/en/reference/pdo/functions/PDO-getAttribute.xml:1.8
> --- phpdoc/en/reference/pdo/functions/PDO-getAttribute.xml:1.7  Tue Sep 20 
> 04:22:28 2005
> +++ phpdoc/en/reference/pdo/functions/PDO-getAttribute.xml      Wed Nov  2 
> 04:47:10 2005
> @@ -1,5 +1,5 @@
>  <?xml version="1.0" encoding="iso-8859-1"?>
> -<!-- $Revision: 1.7 $ -->
> +<!-- $Revision: 1.8 $ -->
>  <!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. 
> -->
>  <refentry id="function.PDO-getAttribute">
>   <refnamediv>
> @@ -76,39 +76,16 @@
>  <![CDATA[
>  <?php
>  $conn = new PDO('odbc:sample', 'db2inst1', 'ibmdb2');
> -
> -print "\nPDO::ATTR_AUTOCOMMIT: ";
> -print $conn->getAttribute(PDO::ATTR_AUTOCOMMIT);
> -
> -print "\nPDO::ATTR_ERRMODE: ";
> -print $conn->getAttribute(PDO::ATTR_ERRMODE);
> -
> -print "\nPDO::ATTR_CASE: ";
> -print $conn->getAttribute(PDO::ATTR_CASE);
> -
> -print "\nPDO::ATTR_CLIENT_VERSION: ";
> -print $conn->getAttribute(PDO::ATTR_CLIENT_VERSION);
> -
> -print "\nPDO::ATTR_CONNECTION_STATUS: ";
> -print $conn->getAttribute(PDO::ATTR_CONNECTION_STATUS);
> -
> -print "\nPDO::ATTR_ORACLE_NULLS: ";
> -print $conn->getAttribute(PDO::ATTR_ORACLE_NULLS);
> -
> -print "\nPDO::ATTR_PERSISTENT: ";
> -print $conn->getAttribute(PDO::ATTR_PERSISTENT);
> -
> -print "\nPDO::ATTR_PREFETCH: ";
> -print $conn->getAttribute(PDO::ATTR_PREFETCH);
> -
> -print "\nPDO::ATTR_SERVER_INFO: ";
> -print $conn->getAttribute(PDO::ATTR_SERVER_INFO);
> -
> -print "\nPDO::ATTR_SERVER_VERSION: ";
> -print $conn->getAttribute(PDO::ATTR_SERVER_VERSION);
> -
> -print "\nPDO::ATTR_TIMEOUT: ";
> -print $conn->getAttribute(PDO::ATTR_TIMEOUT);
> +$attributes = array(
> +    "AUTOCOMMIT", "ERRMODE", "CASE", "CLIENT_VERSION", "CONNECTION_STATUS",
> +    "ORACLE_NULLS", "PERSISTENT", "PREFETCH", "SERVER_INFO", 
> "SERVER_VERSION",
> +    "TIMEOUT"
> +);
> +
> +foreach ($attributes as $val) {
> +    echo "PDO::ATTR_$val: ";
> +    echo $conn->getAttribute(constant("PDO::ATTR_$val")) . "\n";
> +}
>  ?>
>  ]]>
>      </programlisting>
> http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/functions/PDO-setAttribute.xml?r1=1.5&r2=1.6&ty=u
> Index: phpdoc/en/reference/pdo/functions/PDO-setAttribute.xml
> diff -u phpdoc/en/reference/pdo/functions/PDO-setAttribute.xml:1.5 
> phpdoc/en/reference/pdo/functions/PDO-setAttribute.xml:1.6
> --- phpdoc/en/reference/pdo/functions/PDO-setAttribute.xml:1.5  Tue Sep 20 
> 04:22:29 2005
> +++ phpdoc/en/reference/pdo/functions/PDO-setAttribute.xml      Wed Nov  2 
> 04:47:10 2005
> @@ -1,5 +1,5 @@
>  <?xml version='1.0' encoding='iso-8859-1'?>
> -<!-- $Revision: 1.5 $ -->
> +<!-- $Revision: 1.6 $ -->
>  <!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. 
> -->
>    <refentry id="function.PDO-setAttribute">
>     <refnamediv>
> @@ -36,6 +36,45 @@
>          </para></listitem>
>         </itemizedlist>
>        </para></listitem>
> +      <listitem><para><literal>PDO::ATTR_ERRMODE</literal>: Error reporting.
> +       <itemizedlist>
> +        <listitem><para><literal>PDO::ERRMODE_SILENT</literal>:
> +         Just set error codes.</para></listitem>
> +        <listitem><para><literal>PDO::ERRMODE_WARNING</literal>:
> +         Raise <link linkend="e-warning">E_WARNING</link>.</para></listitem>
> +        <listitem><para><literal>PDO::ERRMODE_EXCEPTION</literal>:
> +         Throw <link 
> linkend="language.exceptions">exceptions</link>.</para></listitem>
> +       </itemizedlist>
> +      </para></listitem>
> +      <listitem><para><literal>PDO::ATTR_ORACLE_NULLS</literal>
> +       (available with all drivers, not just Oracle):
> +       Conversion of NULL and empty strings.
> +       <itemizedlist>
> +        <listitem><para><literal>PDO::NULL_NATURAL</literal>:
> +         No conversion.</para></listitem>
> +        <listitem><para><literal>PDO::NULL_EMPTY_STRING</literal>:
> +         Empty string is converted to &null;.</para></listitem>
> +        <listitem><para><literal>PDO::NULL_TO_STRING</literal>:
> +         NULL is converted to an empty string.</para></listitem>
> +       </itemizedlist>
> +      </para></listitem>
> +      <listitem><para><literal>PDO::ATTR_STRINGIFY_FETCHES</literal>:
> +       Convert numeric values to strings when fetching.
> +       Requires <type>bool</type>.
> +      </para></listitem>
> +      <listitem><para><literal>PDO::ATTR_STATEMENT_CLASS</literal>:
> +       Set user-supplied statement class derived from PDOStatement.
> +       Cannot be used with persistent PDO instances.
> +       Requires <literal>array(string classname, array(mixed 
> ctor_args))</literal>.
> +      </para></listitem>
> +      <listitem><para><literal>PDO::ATTR_AUTOCOMMIT</literal>
> +       (available in OCI, Firebird and MySQL):
> +       Whether to autocommit every single statement.
> +      </para></listitem>
> +      <listitem><para><literal>PDO::MYSQL_ATTR_USE_BUFFERED_QUERY</literal>
> +      (available in MySQL):
> +      Use buffered queries.
> +      </para></listitem>
>       </itemizedlist>
>      </para>
>     </refsect1>
> http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/functions/PDOStatement-getAttribute.xml?r1=1.2&r2=1.3&ty=u
> Index: phpdoc/en/reference/pdo/functions/PDOStatement-getAttribute.xml
> diff -u phpdoc/en/reference/pdo/functions/PDOStatement-getAttribute.xml:1.2 
> phpdoc/en/reference/pdo/functions/PDOStatement-getAttribute.xml:1.3
> --- phpdoc/en/reference/pdo/functions/PDOStatement-getAttribute.xml:1.2 Fri 
> May 27 14:53:28 2005
> +++ phpdoc/en/reference/pdo/functions/PDOStatement-getAttribute.xml     Wed 
> Nov  2 04:47:10 2005
> @@ -1,5 +1,5 @@
>  <?xml version="1.0" encoding="iso-8859-1"?>
> -<!-- $Revision: 1.2 $ -->
> +<!-- $Revision: 1.3 $ -->
>  <!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. 
> -->
>  <refentry id="function.PDOStatement-getAttribute">
>   <refnamediv>
> @@ -15,7 +15,14 @@
>     
> <methodparam><type>int</type><parameter>attribute</parameter></methodparam>
>    </methodsynopsis>
>
> -  &warn.undocumented.func;
> +  <para>
> +   Gets an attribute of the statement. Currently, no generic attributes 
> exist but only driver specific:
> +   <itemizedlist>
> +    <listitem><para><literal>PDO::ATTR_CURSOR_NAME</literal> (Firebird 
> specific):
> +     Get the name of cursor.
> +    </para></listitem>
> +   </itemizedlist>
> +  </para>
>
>   </refsect1>
>
> http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/functions/PDOStatement-setAttribute.xml?r1=1.2&r2=1.3&ty=u
> Index: phpdoc/en/reference/pdo/functions/PDOStatement-setAttribute.xml
> diff -u phpdoc/en/reference/pdo/functions/PDOStatement-setAttribute.xml:1.2 
> phpdoc/en/reference/pdo/functions/PDOStatement-setAttribute.xml:1.3
> --- phpdoc/en/reference/pdo/functions/PDOStatement-setAttribute.xml:1.2 Fri 
> May 27 14:53:28 2005
> +++ phpdoc/en/reference/pdo/functions/PDOStatement-setAttribute.xml     Wed 
> Nov  2 04:47:10 2005
> @@ -1,5 +1,5 @@
>  <?xml version="1.0" encoding="iso-8859-1"?>
> -<!-- $Revision: 1.2 $ -->
> +<!-- $Revision: 1.3 $ -->
>  <!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. 
> -->
>  <refentry id="function.PDOStatement-setAttribute">
>   <refnamediv>
> @@ -16,7 +16,14 @@
>     <methodparam><type>mixed</type><parameter>value</parameter></methodparam>
>    </methodsynopsis>
>
> -  &warn.undocumented.func;
> +  <para>
> +   Sets an attribute on the statement. Currently, no generic attributes are 
> set but only driver specific:
> +   <itemizedlist>
> +    <listitem><para><literal>PDO::ATTR_CURSOR_NAME</literal> (Firebird 
> specific):
> +     Set the name of cursor.
> +    </para></listitem>
> +   </itemizedlist>
> +  </para>
>
>   </refsect1>
>
>

Reply via email to