[prev in list] [next in list] [prev in thread] [next in thread]
List: php-doc-cvs
Subject: [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/sqlite3/_sqlite3/construct.xml_sqlite3/enableExc
From: Peter_Cowburn <salathe () php ! net>
Date: 2016-05-17 22:21:57
Message-ID: svn-salathe-1463523717-339180-1867482000 () svn ! php ! net
[Download RAW message or body]
salathe Tue, 17 May 2016 22:21:57 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=339180
Log:
Add SQLite3::enableExceptions()
Also fix initializers for construct/open
--
Based on a patch by Bill Schaller (bill@zeroedin.com)
Changed paths:
U phpdoc/en/trunk/reference/sqlite3/sqlite3/construct.xml
A phpdoc/en/trunk/reference/sqlite3/sqlite3/enableExceptions.xml
U phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml
U phpdoc/en/trunk/reference/sqlite3/versions.xml
Modified: phpdoc/en/trunk/reference/sqlite3/sqlite3/construct.xml
===================================================================
--- phpdoc/en/trunk/reference/sqlite3/sqlite3/construct.xml 2016-05-17 21:15:08 UTC \
(rev 339179)
+++ phpdoc/en/trunk/reference/sqlite3/sqlite3/construct.xml 2016-05-17 22:21:57 UTC \
(rev 339180) @@ -14,8 +14,8 @@
<methodsynopsis>
<modifier>public</modifier> <methodname>SQLite3::__construct</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
- <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
- <methodparam choice="opt"><type>string</type><parameter>encryption_key</parameter></methodparam>
+ <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>SQLITE3_OPEN_READWRITE \
| SQLITE3_OPEN_CREATE</initializer></methodparam> + <methodparam \
choice="opt"><type>string</type><parameter>encryption_key</parameter><initializer>null</initializer></methodparam>
</methodsynopsis>
<para>
Instantiates an SQLite3 object and opens a connection to an
@@ -70,7 +70,8 @@
<listitem>
<para>
An optional encryption key used when encrypting and decrypting an
- SQLite database.
+ SQLite database. If the SQLite encryption module is not installed,
+ this parameter will have no effect.
</para>
</listitem>
</varlistentry>
Added: phpdoc/en/trunk/reference/sqlite3/sqlite3/enableExceptions.xml
===================================================================
--- phpdoc/en/trunk/reference/sqlite3/sqlite3/enableExceptions.xml \
(rev 0)
+++ phpdoc/en/trunk/reference/sqlite3/sqlite3/enableExceptions.xml 2016-05-17 \
22:21:57 UTC (rev 339180) @@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+
+<refentry xml:id="sqlite3.enableexceptions" xmlns="http://docbook.org/ns/docbook" \
xmlns:xlink="http://www.w3.org/1999/xlink"> + <refnamediv>
+ <refname>SQLite3::enableExceptions</refname>
+ <refpurpose>
+ Enable throwing exceptions
+ </refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis role="oop">
+ <type>bool</type><methodname>SQLite3::enableExceptions</methodname>
+ <methodparam choice="opt"><type>bool</type><parameter>enableExceptions</parameter><initializer>false</initializer></methodparam>
+ </methodsynopsis>
+ <para>
+ Controls whether the <classname>SQLite3</classname> instance will
+ throw exceptions or warnings on error.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <variablelist>
+ <varlistentry>
+ <term><parameter>enable</parameter></term>
+ <listitem>
+ <para>
+ When &true;, the <classname>SQLite3</classname> instance, and
+ <classname>SQLite3Stmt</classname> and <classname>SQLite3Result</classname>
+ instances derived from it, will throw exceptions on error.
+ </para>
+ <para>
+ When &false;, the <classname>SQLite3</classname> instance, and
+ <classname>SQLite3Stmt</classname> and <classname>SQLite3Result</classname>
+ instances derived from it, will raise warnings on error.
+ </para>
+ <para>
+ For either mode, the error code and message, if any, will be available via
+ <methodname>SQLite3::lastErrorCode</methodname> and
+ <methodname>SQLite3::lastErrorMsg</methodname> respectively.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns the old value; &true; if exceptions were enabled, &false; otherwise.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example xml:id="sqlite3.enableexceptions.example.basic">
+ <title><methodname>SQLite3::enableExceptions</methodname> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$sqlite = new SQLite3(':memory:');
+try {
+ $sqlite->exec('create table foo');
+ $sqlite->enableExceptions(true);
+ $sqlite->exec('create table bar');
+} catch (Exception $e) {
+ echo 'Caught exception: ' . $e->getMessage();
+}
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen role="php">
+<![CDATA[
+Warning: SQLite3::exec(): near "foo": syntax error in example.php on line 4
+Caught exception: near "bar": syntax error
+]]>
+ </screen>
+ </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-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
+-->
Property changes on: phpdoc/en/trunk/reference/sqlite3/sqlite3/enableExceptions.xml
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy \
HeadURL URL
Modified: phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml
===================================================================
--- phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml 2016-05-17 21:15:08 UTC (rev \
339179)
+++ phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml 2016-05-17 22:21:57 UTC (rev \
339180) @@ -13,7 +13,7 @@
<modifier>public</modifier> \
<type>void</type><methodname>SQLite3::open</methodname> \
<methodparam><type>string</type><parameter>filename</parameter></methodparam> \
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>SQLITE3_OPEN_READWRITE \
| SQLITE3_OPEN_CREATE</initializer></methodparam>
- <methodparam choice="opt"><type>string</type><parameter>encryption_key</parameter></methodparam>
+ <methodparam choice="opt"><type>string</type><parameter>encryption_key</parameter><initializer>null</initializer></methodparam>
</methodsynopsis>
<para>
Opens an SQLite 3 Database. If the build includes encryption, then it will
@@ -67,7 +67,8 @@
<listitem>
<para>
An optional encryption key used when encrypting and decrypting an
- SQLite database.
+ SQLite database. If the SQLite encryption module is not installed,
+ this parameter will have no effect.
</para>
</listitem>
</varlistentry>
Modified: phpdoc/en/trunk/reference/sqlite3/versions.xml
===================================================================
--- phpdoc/en/trunk/reference/sqlite3/versions.xml 2016-05-17 21:15:08 UTC (rev \
339179)
+++ phpdoc/en/trunk/reference/sqlite3/versions.xml 2016-05-17 22:21:57 UTC (rev \
339180) @@ -13,6 +13,7 @@
<function name="SQLite3::createAggregate" from="PHP 5 >= 5.3.0, PHP 7"/>
<function name="SQLite3::createCollation" from="PHP 5 >= 5.3.11, PHP 7"/>
<function name="SQLite3::createFunction" from="PHP 5 >= 5.3.0, PHP 7"/>
+ <function name="SQLite3::enableExceptions" from="PHP 5 >= 5.3.0, PHP 7"/>
<function name="SQLite3::escapeString" from="PHP 5 >= 5.3.0, PHP 7"/>
<function name="SQLite3::exec" from="PHP 5 >= 5.3.0, PHP 7"/>
<function name="SQLite3::lastErrorCode" from="PHP 5 >= 5.3.0, PHP 7"/>
--
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic