[PHP-DOC] cvs: phpdoc /it/functions dbm.xml From: Luca Perugini (l.perugini <email protected>)
Date: 08/31/00

perugini Thu Aug 31 09:28:45 2000 EDT

  Modified files:
    /phpdoc/it/functions dbm.xml
  Log:
  Sync with en tree.
  
  
Index: phpdoc/it/functions/dbm.xml
diff -u phpdoc/it/functions/dbm.xml:1.2 phpdoc/it/functions/dbm.xml:1.3
--- phpdoc/it/functions/dbm.xml:1.2 Sat Jun 24 00:38:44 2000
+++ phpdoc/it/functions/dbm.xml Thu Aug 31 09:28:45 2000
@@ -1,35 +1,37 @@
  <reference id="ref.dbm">
- <title>dbm functions</title>
+ <title>DBM Functions</title>
   <titleabbrev>DBM</titleabbrev>
 
   <partintro>
- <simpara>
- These functions allow you to store records stored in a dbm-style
- database. This type of database (supported by the Berkeley db,
- gdbm, and some system libraries, as well as a built-in flatfile
- library) stores key/value pairs (as opposed to the full-blown
- records supported by relational databases).</simpara>
- <para>
- <example>
- <title>dbm example</title>
- <programlisting role="php">
-$dbm = dbmopen("lastseen", "w");
-if (dbmexists($dbm, $userid)) {
- $last_seen = dbmfetch($dbm, $userid);
+ <simpara>
+ These functions allow you to store records stored in a dbm-style
+ database. This type of database (supported by the Berkeley DB,
+ GDBM, and some system libraries, as well as a built-in flatfile
+ library) stores key/value pairs (as opposed to the full-blown
+ records supported by relational databases).
+ </simpara>
+ <para>
+ <example>
+ <title>DBM example</title>
+ <programlisting role="php">
+$dbm = dbmopen ("lastseen", "w");
+if (dbmexists ($dbm, $userid)) {
+ $last_seen = dbmfetch ($dbm, $userid);
 } else {
- dbminsert($dbm, $userid, time());
+ dbminsert ($dbm, $userid, time());
 }
 do_stuff();
-dbmreplace($dbm, $userid, time());
-dbmclose($dbm);
-</programlisting></example>
- </para>
+dbmreplace ($dbm, $userid, time());
+dbmclose ($dbm);
+ </programlisting>
+ </example>
+ </para>
   </partintro>
 
   <refentry id="function.dbmopen">
    <refnamediv>
     <refname>dbmopen</refname>
- <refpurpose>opens a dbm database</refpurpose>
+ <refpurpose>Opens a DBM database</refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -41,31 +43,37 @@
      </funcprototype>
     </funcsynopsis>
     <para>
- The first argument is the full-path filename of the dbm file to be opened
- and the second is the file open mode which is one of "r", "n", "c" or "w"
- for read-only, new (implies read-write, and most likely will truncate an
- already-existing database of the same name), create (implies read-write,
- and will not truncate an already-existing database of the same name)
- and read-write respectively.</para>
- <para>
- Returns an identifer to be passed to the other dbm functions on success,
- or false on failure.</para>
- <para>
- If ndbm support is used, ndbm will actually create filename.dir and
- filename.pag files. gdbm only uses one file, as does the internal flat-file
- support, and Berkeley db creates a filename.db file. Note that PHP does its
- own file locking in addition to any file locking that may be done by the dbm
- library itself. PHP does not delete the .lck files it creates. It uses these
- files simply as fixed inodes on which to do the file locking. For more
- information on dbm files, see your Unix man pages, or obtain GNU's gdbm from
- <filename role="url">ftp://prep.ai.mit.edu/pub/gnu>.</para>
+ The first argument is the full-path filename of the DBM file to
+ be opened and the second is the file open mode which is one of
+ "r", "n", "c" or "w" for read-only, new (implies read-write, and
+ most likely will truncate an already-existing database of the
+ same name), create (implies read-write, and will not truncate an
+ already-existing database of the same name) and read-write
+ respectively.
+ </para>
+ <para>
+ Returns an identifer to be passed to the other DBM functions on
+ success, or false on failure.
+ </para>
+ <para>
+ If NDBM support is used, NDBM will actually create filename.dir
+ and filename.pag files. GDBM only uses one file, as does the
+ internal flat-file support, and Berkeley DB creates a
+ <filename>filename.db</filename> file. Note that PHP does its own
+ file locking in addition to any file locking that may be done by
+ the DBM library itself. PHP does not delete the
+ <filename>.lck</filename> files it creates. It uses these files
+ simply as fixed inodes on which to do the file locking. For more
+ information on DBM files, see your Unix man pages, or obtain
+ <ulink url="&url.gdbm;">GNU's GDBM</ulink>.
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbmclose">
    <refnamediv>
     <refname>dbmclose</refname>
- <refpurpose>closes a dbm database</refpurpose>
+ <refpurpose>Closes a dbm database</refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -76,14 +84,17 @@
      </funcprototype>
     </funcsynopsis>
     <para>
- Unlocks and closes the specified database.</para>
+ Unlocks and closes the specified database.
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbmexists">
    <refnamediv>
     <refname>dbmexists</refname>
- <refpurpose>tells if a value exists for a key in a dbm database</refpurpose>
+ <refpurpose>
+ Tells if a value exists for a key in a DBM database
+ </refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -95,14 +106,18 @@
      </funcprototype>
     </funcsynopsis>
     <para>
- Returns true if there is a value associated with the <parameter>key</parameter>.</para>
+ Returns TRUE if there is a value associated with the
+ <parameter>key</parameter>.
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbmfetch">
    <refnamediv>
     <refname>dbmfetch</refname>
- <refpurpose>fetches a value for a key from a dbm database</refpurpose>
+ <refpurpose>
+ Fetches a value for a key from a DBM database
+ </refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -114,14 +129,17 @@
      </funcprototype>
     </funcsynopsis>
     <para>
- Returns the value associated with <parameter>key</parameter>.</para>
+ Returns the value associated with <parameter>key</parameter>.
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbminsert">
    <refnamediv>
     <refname>dbminsert</refname>
- <refpurpose>inserts a value for a key in a dbm database</refpurpose>
+ <refpurpose>
+ Inserts a value for a key in a DBM database
+ </refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -134,18 +152,22 @@
      </funcprototype>
     </funcsynopsis>
     <para>
- Adds the value to the database with the specified key.</para>
+ Adds the value to the database with the specified key.
+ </para>
     <para>
      Returns -1 if the database was opened read-only, 0 if the insert
- was successful, and 1 if the specified key already exists. (To replace
- the value, use <function>dbmreplace</function>.)</para>
+ was successful, and 1 if the specified key already exists. (To
+ replace the value, use <function>dbmreplace</function>.)
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbmreplace">
    <refnamediv>
     <refname>dbmreplace</refname>
- <refpurpose>replaces the value for a key in a dbm database</refpurpose>
+ <refpurpose>
+ Replaces the value for a key in a DBM database
+ </refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -158,17 +180,21 @@
      </funcprototype>
     </funcsynopsis>
     <para>
- Replaces the value for the specified key in the database.</para>
+ Replaces the value for the specified key in the database.
+ </para>
     <para>
      This will also add the key to the database if it didn't already
- exist.</para>
+ exist.
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbmdelete">
    <refnamediv>
     <refname>dbmdelete</refname>
- <refpurpose>deletes the value for a key from a dbm database</refpurpose>
+ <refpurpose>
+ Deletes the value for a key from a DBM database
+ </refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -180,16 +206,20 @@
      </funcprototype>
     </funcsynopsis>
     <para>
- Deletes the value for <parameter>key</parameter> in the database.</para>
+ Deletes the value for <parameter>key</parameter> in the database.
+ </para>
     <para>
- Returns false if the key didn't exist in the database.</para>
+ Returns false if the key didn't exist in the database.
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbmfirstkey">
    <refnamediv>
     <refname>dbmfirstkey</refname>
- <refpurpose>retrieves the first key from a dbm database</refpurpose>
+ <refpurpose>
+ Retrieves the first key from a DBM database
+ </refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -202,14 +232,16 @@
     <para>
      Returns the first key in the database. Note that no particular order
      is guaranteed since the database may be built using a hash-table,
- which doesn't guarantee any ordering.</para>
+ which doesn't guarantee any ordering.
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dbmnextkey">
    <refnamediv>
     <refname>dbmnextkey</refname>
- <refpurpose>retrieves the next key from a dbm database</refpurpose>
+ <refpurpose>
+ Retrieves the next key from a DBM database</refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -225,23 +257,26 @@
      <function>dbmfirstkey</function> followed by successive
      calls to <function>dbmnextkey</function> it is possible to
      visit every key/value pair in the dbm database. For example:
- <example>
- <title>Visiting every key/value pair in a dbm database.</title>
- <programlisting>
-$key = dbmfirstkey($dbm_id);
+ <example>
+ <title>Visiting every key/value pair in a DBM database</title>
+ <programlisting role="php">
+$key = dbmfirstkey ($dbm_id);
 while ($key) {
- echo "$key = " . dbmfetch($dbm_id, $key) . "\n";
- $key = dbmnextkey($dbm_id, $key);
+ echo "$key = " . dbmfetch ($dbm_id, $key) . "\n";
+ $key = dbmnextkey ($dbm_id, $key);
 }
      </programlisting>
- </example></para>
+ </example>
+ </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.dblist">
    <refnamediv>
     <refname>dblist</refname>
- <refpurpose>describes the dbm-compatible library being used</refpurpose>
+ <refpurpose>
+ Describes the DBM-compatible library being used
+ </refpurpose>
    </refnamediv>
    <refsect1>
     <title>Description</title>
@@ -266,7 +301,7 @@
 sgml-indent-step:1
 sgml-indent-data:t
 sgml-parent-document:nil
-sgml-default-dtd-file:"../manual.ced"
+sgml-default-dtd-file:"../../manual.ced"
 sgml-exposed-tags:nil
 sgml-local-catalogs:nil
 sgml-local-ecat-files:nil