cvs: phpdoc /en/reference/dba book.xml constants.xml examples.xml reference.xml setup.xml

From: Date: Sun, 16 Dec 2007 11:39:06 +0000
Subject: cvs: phpdoc /en/reference/dba book.xml constants.xml examples.xml reference.xml setup.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-654@lists.php.net to get a copy of this message
bjori Sun Dec 16 11:39:06 2007 UTC Modified files: /phpdoc/en/reference/dba book.xml constants.xml examples.xml setup.xml reference.xml Log: MFB: Upgrade to the new-reference-structure - Moved the intro from reference.xml to book.xml - Change the intro ID to intro.<extname> - Moved examples into its own chapter - (Note: the first example ID was changed to "dba.example" And the example chapter got the ID "dba.examples" - Moved the setup sections to setup.xml - Added empty constants <appendix>

http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/dba/book.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/dba/book.xml diff -u /dev/null phpdoc/en/reference/dba/book.xml:1.2 --- /dev/null Sun Dec 16 11:39:06 2007 +++ phpdoc/en/reference/dba/book.xml Sun Dec 16 11:39:06 2007 @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<!-- Purpose: database.abstract --> +<!-- Membership: bundled --> + +<book xml:id="book.dba" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Database (dbm-style) Abstraction Layer</title> + + <!-- {{{ preface --> + <preface xml:id="intro.dba"> + &reftitle.intro; + <para> + These functions build the foundation for accessing Berkeley DB + style databases. + </para> + <para> + This is a general abstraction layer for several file-based databases. + As such, functionality is limited to a common subset of features + supported by modern databases such as + <link xlink:href="&url.sleepycat;">Sleepycat Software's DB2</link>. + (This is not to be confused with IBM's DB2 software, which is + supported through the <link linkend="ref.uodbc">ODBC functions</link>.) + </para> + </preface> + <!-- }}} --> + + &reference.dba.setup; + &reference.dba.constants; + &reference.dba.examples; + &reference.dba.reference; + +</book> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/dba/constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/dba/constants.xml diff -u /dev/null phpdoc/en/reference/dba/constants.xml:1.2 --- /dev/null Sun Dec 16 11:39:06 2007 +++ phpdoc/en/reference/dba/constants.xml Sun Dec 16 11:39:06 2007 @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> + +<appendix xml:id="dba.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + &no.constants; +</appendix> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/dba/examples.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/dba/examples.xml diff -u /dev/null phpdoc/en/reference/dba/examples.xml:1.2 --- /dev/null Sun Dec 16 11:39:06 2007 +++ phpdoc/en/reference/dba/examples.xml Sun Dec 16 11:39:06 2007 @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> + +<chapter xml:id="dba.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.examples; + <section xml:id="dba.example"> + <title>Basic usage</title> + <para> + <example> + <title>DBA example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$id = dba_open("/tmp/test.db", "n", "db2"); + +if (!$id) { + echo "dba_open failed\n"; + exit; +} + +dba_replace("key", "This is an example!", $id); + +if (dba_exists("key", $id)) { + echo dba_fetch("key", $id); + dba_delete("key", $id); +} + +dba_close($id); +?> +]]> + </programlisting> + </example> + </para> + <para> + DBA is binary safe and does not have any arbitrary limits. + However, it inherits all limits set by the underlying + database implementation. + </para> + <para> + All file-based databases must provide a way of setting the file + mode of a new created database, if that is possible at all. The + file mode is commonly passed as the fourth argument to + <function>dba_open</function> or <function>dba_popen</function>. + </para> + <para> + You can access all entries of a database in a linear way by using the + <function>dba_firstkey</function> and <function>dba_nextkey</function> + functions. You may not change the database while traversing it. + </para> + <para> + <example> + <title>Traversing a database</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// ...open database... + +$key = dba_firstkey($id); + +while ($key != false) { + if (true) { // remember the key to perform some action later + $handle_later[] = $key; + } + $key = dba_nextkey($id); +} + +foreach ($handle_later as $val) { + dba_delete($val, $id); +} + +?> +]]> + </programlisting> + </example> + </para> + </section> +</chapter> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/dba/setup.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/dba/setup.xml diff -u /dev/null phpdoc/en/reference/dba/setup.xml:1.2 --- /dev/null Sun Dec 16 11:39:06 2007 +++ phpdoc/en/reference/dba/setup.xml Sun Dec 16 11:39:06 2007 @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> + +<chapter xml:id="dba.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.setup; + + <!-- {{{ Requirements --> + <section xml:id="dba.requirements"> + &reftitle.required; + <para> + The behaviour of various aspects depends on the implementation of the + underlying database. Functions such as <function>dba_optimize</function> + and <function>dba_sync</function> will do what they promise for one + database and will do nothing for others. You have to download and install + supported dba-Handlers. + <table> + <title>List of DBA handlers</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Handler</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>dbm</literal></entry> + <entry> + Dbm is the oldest (original) type of Berkeley DB style + databases. You should avoid it, if possible. We do not support + the compatibility functions built into DB2 and gdbm, because + they are only compatible on the source code level, but cannot + handle the original dbm format. + </entry> + </row> + + <row> + <entry><literal>ndbm</literal></entry> + <entry> + Ndbm is a newer type and more flexible than dbm. It still has + most of the arbitrary limits of dbm (therefore it is + deprecated). + </entry> + </row> + + <row> + <entry><literal>gdbm</literal></entry> + <entry> + Gdbm is the <link xlink:href="&url.gdbm;">GNU database + manager</link>. + </entry> + </row> + + <row> + <entry><literal>db2</literal></entry> + <entry> + DB2 is <link xlink:href="&url.sleepycat;">Sleepycat Software's + DB2</link>. It is described as "a programmatic toolkit that + provides high-performance built-in database support for both + standalone and client/server applications. + </entry> + </row> + + <row> + <entry><literal>db3</literal></entry> + <entry> + DB3 is <link xlink:href="&url.sleepycat;">Sleepycat Software's + DB3</link>. + </entry> + </row> + + <row> + <entry><literal>db4</literal></entry> + <entry> + DB4 is <link xlink:href="&url.sleepycat;">Sleepycat Software's + DB4</link>. This is available since PHP 4.3.2. + </entry> + </row> + + <row> + <entry><literal>cdb</literal></entry> + <entry> + Cdb is "a fast, reliable, lightweight package for creating and + reading constant databases." It is from the author of qmail and + can be found at <link xlink:href="&url.cdb;">&url.cdb;</link>. Since it is + constant, we support only reading operations. And since PHP 4.3.0 + we support writing (not updating) through the internal cdb library. + </entry> + </row> + + <row> + <entry><literal>cdb_make</literal></entry> + <entry> + Since PHP 4.3.0 we support creation (not updating) of cdb files + when the bundled cdb library is used. + </entry> + </row> + + <row> + <entry><literal>flatfile</literal></entry> + <entry> + This is available since PHP 4.3.0 for compatibility with the deprecated + <link linkend="ref.dbm">dbm</link> extension only and should be avoided. + However you may use this where files were created in this format. That + happens when configure could not find any external library. + </entry> + </row> + + <row> + <entry><literal>inifile</literal></entry> + <entry> + This is available since PHP 4.3.3 to be able to modify php.ini files + from within PHP scripts. When working with ini files you can pass arrays + of the form array(0=>group,1=>value_name) or strings of the form + "[group]value_name" where group is optional. As the functions + <function>dba_firstkey</function> and <function>dba_nextkey</function> + return string representations of the key there is a new function + <function>dba_key_split</function> available since PHP 5 which allows + to convert the string keys into array keys without loosing &false;. + </entry> + </row> + + <row> + <entry><literal>qdbm</literal></entry> + <entry> + This is available since PHP 5.0.0. The qdbm library can be loaded from + <link xlink:href="http://qdbm.sourceforge.net">http://qdbm.sourceforge.net</link>. + </entry> + </row> + + </tbody> + </tgroup> + </table> + </para> + <para> + When invoking the <function>dba_open</function> or + <function>dba_popen</function> functions, one of the + handler names must be supplied as an argument. The actually + available list of handlers is displayed by invoking + <function>phpinfo</function> or <function>dba_handlers</function>. + </para> + </section> + <!-- }}} --> + + <!-- {{{ Installation --> + &reference.dba.configure; + <!-- }}} --> + + <!-- {{{ Configuration --> + <section xml:id="dba.configuration"> + &reftitle.runtime; + &no.config; + </section> + <!-- }}} --> + + <!-- {{{ Resources --> + <section xml:id="dba.resources"> + &reftitle.resources; + <para> + The functions <function>dba_open</function> and + <function>dba_popen</function> return a handle to the specified + database file to access which is used by all other dba-function calls. + </para> + </section> + <!-- }}} --> + +</chapter> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/dba/reference.xml?r1=1.27&r2=1.28&diff_format=u Index: phpdoc/en/reference/dba/reference.xml diff -u phpdoc/en/reference/dba/reference.xml:1.27 phpdoc/en/reference/dba/reference.xml:1.28 --- phpdoc/en/reference/dba/reference.xml:1.27 Mon Dec 10 17:06:02 2007 +++ phpdoc/en/reference/dba/reference.xml Sun Dec 16 11:39:06 2007 @@ -1,264 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.27 $ --> -<!-- Purpose: database.abstract --> -<!-- Membership: bundled --> +<!-- $Revision: 1.28 $ --> - <reference xml:id="ref.dba" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> - <title>Database (dbm-style) Abstraction Layer Functions</title> - <titleabbrev>dba</titleabbrev> - - <partintro> - <section xml:id="dba.intro"> - &reftitle.intro; - <para> - These functions build the foundation for accessing Berkeley DB - style databases. - </para> - <para> - This is a general abstraction layer for several file-based databases. - As such, functionality is limited to a common subset of features - supported by modern databases such as - <link xlink:href="&url.sleepycat;">Sleepycat Software's DB2</link>. - (This is not to be confused with IBM's DB2 software, which is - supported through the <link linkend="ref.uodbc">ODBC functions</link>.) - </para> - </section> - <section xml:id="dba.requirements"> - &reftitle.required; - <para> - The behaviour of various aspects depends on the implementation of the - underlying database. Functions such as <function>dba_optimize</function> - and <function>dba_sync</function> will do what they promise for one - database and will do nothing for others. You have to download and install - supported dba-Handlers. - <table> - <title>List of DBA handlers</title> - <tgroup cols="2"> - <thead> - <row> - <entry>Handler</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><literal>dbm</literal></entry> - <entry> - Dbm is the oldest (original) type of Berkeley DB style - databases. You should avoid it, if possible. We do not support - the compatibility functions built into DB2 and gdbm, because - they are only compatible on the source code level, but cannot - handle the original dbm format. - </entry> - </row> - - <row> - <entry><literal>ndbm</literal></entry> - <entry> - Ndbm is a newer type and more flexible than dbm. It still has - most of the arbitrary limits of dbm (therefore it is - deprecated). - </entry> - </row> - - <row> - <entry><literal>gdbm</literal></entry> - <entry> - Gdbm is the <link xlink:href="&url.gdbm;">GNU database - manager</link>. - </entry> - </row> - - <row> - <entry><literal>db2</literal></entry> - <entry> - DB2 is <link xlink:href="&url.sleepycat;">Sleepycat Software's - DB2</link>. It is described as "a programmatic toolkit that - provides high-performance built-in database support for both - standalone and client/server applications. - </entry> - </row> - - <row> - <entry><literal>db3</literal></entry> - <entry> - DB3 is <link xlink:href="&url.sleepycat;">Sleepycat Software's - DB3</link>. - </entry> - </row> - - <row> - <entry><literal>db4</literal></entry> - <entry> - DB4 is <link xlink:href="&url.sleepycat;">Sleepycat Software's - DB4</link>. This is available since PHP 4.3.2. - </entry> - </row> - - <row> - <entry><literal>cdb</literal></entry> - <entry> - Cdb is "a fast, reliable, lightweight package for creating and - reading constant databases." It is from the author of qmail and - can be found at <link xlink:href="&url.cdb;">&url.cdb;</link>. Since it is - constant, we support only reading operations. And since PHP 4.3.0 - we support writing (not updating) through the internal cdb library. - </entry> - </row> - - <row> - <entry><literal>cdb_make</literal></entry> - <entry> - Since PHP 4.3.0 we support creation (not updating) of cdb files - when the bundled cdb library is used. - </entry> - </row> - - <row> - <entry><literal>flatfile</literal></entry> - <entry> - This is available since PHP 4.3.0 for compatibility with the deprecated - <link linkend="ref.dbm">dbm</link> extension only and should be avoided. - However you may use this where files were created in this format. That - happens when configure could not find any external library. - </entry> - </row> - - <row> - <entry><literal>inifile</literal></entry> - <entry> - This is available since PHP 4.3.3 to be able to modify php.ini files - from within PHP scripts. When working with ini files you can pass arrays - of the form array(0=>group,1=>value_name) or strings of the form - "[group]value_name" where group is optional. As the functions - <function>dba_firstkey</function> and <function>dba_nextkey</function> - return string representations of the key there is a new function - <function>dba_key_split</function> available since PHP 5 which allows - to convert the string keys into array keys without loosing &false;. - </entry> - </row> - - <row> - <entry><literal>qdbm</literal></entry> - <entry> - This is available since PHP 5.0.0. The qdbm library can be loaded from - <link xlink:href="http://qdbm.sourceforge.net">http://qdbm.sourceforge.net</link>. - </entry> - </row> - - </tbody> - </tgroup> - </table> - </para> - <para> - When invoking the <function>dba_open</function> or - <function>dba_popen</function> functions, one of the - handler names must be supplied as an argument. The actually - available list of handlers is displayed by invoking - <function>phpinfo</function> or <function>dba_handlers</function>. - </para> - </section> - - &reference.dba.configure; - - <section xml:id="dba.runtime"> - &reftitle.runtime; - &no.config; - </section> - - <section xml:id="dba.resources"> - &reftitle.resources; - <para> - The functions <function>dba_open</function> and - <function>dba_popen</function> return a handle to the specified - database file to access which is used by all other dba-function calls. - </para> - </section> - - <section xml:id="dba.constants"> - &reftitle.constants; - &no.constants; - </section> - - <section xml:id="dba.examples"> - &reftitle.examples; - <para> - <example> - <title>DBA example</title> - <programlisting role="php"> -<![CDATA[ -<?php - -$id = dba_open("/tmp/test.db", "n", "db2"); - -if (!$id) { - echo "dba_open failed\n"; - exit; -} - -dba_replace("key", "This is an example!", $id); - -if (dba_exists("key", $id)) { - echo dba_fetch("key", $id); - dba_delete("key", $id); -} - -dba_close($id); -?> -]]> - </programlisting> - </example> - </para> - <para> - DBA is binary safe and does not have any arbitrary limits. - However, it inherits all limits set by the underlying - database implementation. - </para> - <para> - All file-based databases must provide a way of setting the file - mode of a new created database, if that is possible at all. The - file mode is commonly passed as the fourth argument to - <function>dba_open</function> or <function>dba_popen</function>. - </para> - <para> - You can access all entries of a database in a linear way by using the - <function>dba_firstkey</function> and <function>dba_nextkey</function> - functions. You may not change the database while traversing it. - </para> - <para> - <example> - <title>Traversing a database</title> - <programlisting role="php"> -<![CDATA[ -<?php - -// ...open database... - -$key = dba_firstkey($id); - -while ($key != false) { - if (true) { // remember the key to perform some action later - $handle_later[] = $key; - } - $key = dba_nextkey($id); -} - -foreach ($handle_later as $val) { - dba_delete($val, $id); -} - -?> -]]> - </programlisting> - </example> - </para> - </section> - - </partintro> +<reference xml:id="ref.dba" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Database (dbm-style) Abstraction Layer &Functions;</title> + <titleabbrev>dba</titleabbrev> &reference.dba.entities.functions; - </reference> +</reference> <!-- Keep this comment at the end of the file Local variables: mode: sgml
« previous php.doc.cvs (#654) next »