cvs: peardoc /en/package/database/db/db-common setoption.xml

From: Date: Tue, 27 Jan 2004 04:44:26 +0000
Subject: cvs: peardoc /en/package/database/db/db-common setoption.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-2193@lists.php.net to get a copy of this message
danielc Mon Jan 26 23:44:26 2004 EDT Added files: /peardoc/en/package/database/db/db-common setoption.xml Log: Add setOption() docs. http://cvs.php.net/co.php/peardoc/en/package/database/db/db-common/setoption.xml?r=1.1&p=1 Index: peardoc/en/package/database/db/db-common/setoption.xml +++ peardoc/en/package/database/db/db-common/setoption.xml <!-- $Revision: 1.1 $ --> <refentry id="package.database.db.db-common.setoption"> <refnamediv> <refname>DB_Common::setOption()</refname> <refpurpose>Set run-time configuration options for PEAR DB</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>int <function>DB_common::setOption</function></funcdef> <paramdef>string <parameter>$option</parameter></paramdef> <paramdef>mixed <parameter>$value</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.database.db.db-common.setoption.desc"> &title.desc; <para> </para> </refsect1> <refsect1 id="package.database.db.db-common.setoption.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$option</parameter> </term> <listitem> <para> name of the option to set </para> </listitem> </varlistentry> <varlistentry> <term> &type.mixed; <parameter>$value</parameter> </term> <listitem> <para> value to set the option to </para> </listitem> </varlistentry> </variablelist> </para> <para> <table> <title></title> <tgroup cols="4"> <thead> <row> <entry>Option</entry> <entry>Data Type</entry> <entry>Default Value</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry> autofree </entry> <entry> &type.bool; </entry> <entry> &false; </entry> <entry> should results be freed automatically when there are no more rows? </entry> </row> <row> <entry> debug </entry> <entry> &type.int; </entry> <entry> 0 </entry> <entry> debug level </entry> </row> <row> <entry> persistent </entry> <entry> &type.bool; </entry> <entry> $false; </entry> <entry> should the connection be persistent? </entry> </row> <row> <entry> portability </entry> <entry> &type.int; </entry> <entry> <constant>DB_PORTABILITY_NONE</constant> </entry> <entry> portability mode constant. These constants are bitwised, so they can be combined using <screen>|</screen> and removed using <screen>^</screen>. See the examples below and the <link linkend="package.database.db.intro-portability"> Introduction - Portability</link> for more information. </entry> </row> <row> <entry> seqname_format </entry> <entry> &type.string; </entry> <entry> the sprintf() format string used on sequence names. This format is applied to sequence names passed to <function>createSequence()</function>, <function>nextID()</function> and <function>dropSequence()</function>. </entry> <entry> </entry> </row> <row> <entry> ssl </entry> <entry> &type.bool; </entry> <entry> &false; </entry> <entry> use ssl to connect? </entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.database.db.db-common.setoption.return"> &title.returns; <para> <parameter>int</parameter> - &constant.db-ok; on success. &class.db-error; object on failure. </para> </refsect1> <refsect1 id="package.database.db.db-common.setoption.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Reason</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry>&null;</entry> <entry> <parameter>unknown option</parameter> </entry> <entry> The given option does not exist </entry> <entry> Check <parameter>$option</parameter> for typographical errors </entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.database.db.db-common.setoption.note"> &title.note; &note.notstatic; </refsect1> <refsect1 id="package.database.db.db-common.setoption.example"> &title.example; <example> <title>Simple <function>setOption</function> example</title> <programlisting role="php"> <![CDATA[ <?php // Once you have a valid DB object named $db... $db->setOption('autofree', true); ?> ]]> </programlisting> </example> <example> <title>Portability for lowercasing and trimming</title> <programlisting role="php"> <![CDATA[ <?php // Once you have a valid DB object named $db... $db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_RTRIM); ?> ]]> </programlisting> </example> <example> <title>All portability options except trimming</title> <programlisting role="php"> <![CDATA[ <?php // Once you have a valid DB object named $db... $db->setOption('portability', DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM); ?> ]]> </programlisting> </example> </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-setfetchmode-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../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 -->

« previous php.pear.doc (#2193) next »