Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions reference/sqlite3/sqlite3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,31 @@
<varlistentry xml:id="sqlite3.constants.ok">
<term><constant>SQLite3::OK</constant></term>
<listitem>
<para/>
<simpara>
Returned from an authorizer callback to allow the action.
</simpara>
</listitem>
</varlistentry>

<varlistentry xml:id="sqlite3.constants.deny">
<term><constant>SQLite3::DENY</constant></term>
<listitem>
<para/>
<simpara>
Returned from an authorizer callback to reject the entire SQL statement
with an error.
</simpara>
</listitem>
</varlistentry>

<varlistentry xml:id="sqlite3.constants.ignore">
<term><constant>SQLite3::IGNORE</constant></term>
<listitem>
<para/>
<simpara>
Returned from an authorizer callback to disallow the specific action
while still allowing the SQL statement to be compiled. See
<methodname>SQLite3::setAuthorizer</methodname> for the effect on each
action.
</simpara>
</listitem>
</varlistentry>

Expand Down
114 changes: 114 additions & 0 deletions reference/sqlite3/sqlite3/enableextendedresultcodes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="sqlite3.enableextendedresultcodes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SQLite3::enableExtendedResultCodes</refname>
<refpurpose>
Enables or disables the use of extended result codes
</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="SQLite3">
<modifier>public</modifier> <type>bool</type><methodname>SQLite3::enableExtendedResultCodes</methodname>
<methodparam choice="opt"><type>bool</type><parameter>enable</parameter><initializer>&true;</initializer></methodparam>
</methodsynopsis>
<simpara>
Enables or disables the use of extended result codes, which are then
reported by <methodname>SQLite3::lastErrorCode</methodname>.
<methodname>SQLite3::lastExtendedErrorCode</methodname> is not affected by
this setting, and always returns the extended result code.
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>enable</parameter></term>
<listitem>
<simpara>
Whether to enable (&true;) or disable (&false;) the use of extended
result codes.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
&return.success;
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title><methodname>SQLite3::enableExtendedResultCodes</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
$db = new SQLite3(':memory:');
$db->enableExceptions(true);
$db->exec('CREATE TABLE t (a INTEGER UNIQUE)');
$db->exec('INSERT INTO t VALUES (1)');

try {
$db->exec('INSERT INTO t VALUES (1)');
} catch (Exception $e) {
}

// The primary result code (SQLITE_CONSTRAINT), then the extended result
// code (SQLITE_CONSTRAINT_UNIQUE).
var_dump($db->lastErrorCode(), $db->lastExtendedErrorCode());

// Once enabled, SQLite3::lastErrorCode() reports the extended result code
// as well.
$db->enableExtendedResultCodes();
var_dump($db->lastErrorCode());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
int(19)
int(2067)
int(2067)
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>SQLite3::lastExtendedErrorCode</methodname></member>
<member><methodname>SQLite3::lastErrorCode</methodname></member>
</simplelist>
</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
-->
9 changes: 9 additions & 0 deletions reference/sqlite3/sqlite3/lasterrorcode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>SQLite3::lastExtendedErrorCode</methodname></member>
<member><methodname>SQLite3::enableExtendedResultCodes</methodname></member>
<member><methodname>SQLite3::lastErrorMsg</methodname></member>
</simplelist>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down
69 changes: 69 additions & 0 deletions reference/sqlite3/sqlite3/lastextendederrorcode.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="sqlite3.lastextendederrorcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SQLite3::lastExtendedErrorCode</refname>
<refpurpose>
Returns the numeric extended result code of the most recent failed
SQLite request
</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="SQLite3">
<modifier>public</modifier> <type>int</type><methodname>SQLite3::lastExtendedErrorCode</methodname>
<void/>
</methodsynopsis>
<simpara>
Returns the numeric extended result code of the most recent failed SQLite
request. Unlike <methodname>SQLite3::lastErrorCode</methodname>, this method
always returns the extended result code, whether or not extended result
codes have been enabled with
<methodname>SQLite3::enableExtendedResultCodes</methodname>.
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns an integer value representing the numeric extended result code of
the most recent failed SQLite request.
</simpara>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>SQLite3::enableExtendedResultCodes</methodname></member>
<member><methodname>SQLite3::lastErrorCode</methodname></member>
<member><methodname>SQLite3::lastErrorMsg</methodname></member>
</simplelist>
</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
-->
4 changes: 3 additions & 1 deletion reference/sqlite3/versions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
<function name="SQLite3::createCollation" from="PHP 5 &gt;= 5.3.11, PHP 7, PHP 8"/>
<function name="SQLite3::createFunction" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::enableExceptions" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::enableExtendedResultCodes" from="PHP 7 &gt;= 7.4.0, PHP 8"/>
<function name="SQLite3::escapeString" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::exec" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::lastErrorCode" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::lastErrorMsg" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::lastInsertRowId" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::lastExtendedErrorCode" from="PHP 7 &gt;= 7.4.0, PHP 8"/>
<function name="SQLite3::lastInsertRowID" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::loadExtension" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::open" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
<function name="SQLite3::openBlob" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>
Expand Down