cvs: pear /DB_DBA DBA.php DBA_Builtin.php DBA_Compat.php DBA_Relational.php DBA_Simple.php DBA_Table.php package.xml /DB_DBA/docs README.txt
/DB_DBA/tests benchmark_drivers.php test_relational.php test_simple.php test_table.php
| From: | Brent Cook | Date: | Sat, 06 Jul 2002 22:57:04 +0000 |
| Subject: | cvs: pear /DB_DBA DBA.php DBA_Builtin.php DBA_Compat.php DBA_Relational.php DBA_Simple.php DBA_Table.php package.xml /DB_DBA/docs README.txt /DB_DBA/tests benchmark_drivers.php test_relational.php test_simple.php test_table.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4933@lists.php.net to get a copy of this message | ||
busterb Sat Jul 6 18:57:04 2002 EDT
Modified files:
/pear/DB_DBA DBA.php DBA_Builtin.php DBA_Compat.php
DBA_Relational.php DBA_Simple.php DBA_Table.php
package.xml
/pear/DB_DBA/docs README.txt
/pear/DB_DBA/tests benchmark_drivers.php test_relational.php
test_simple.php test_table.php
Log:
changed license to LGPL; bumped version in preparation for initial release
Index: pear/DB_DBA/DBA.php diff -u pear/DB_DBA/DBA.php:1.5 pear/DB_DBA/DBA.php:1.6 --- pear/DB_DBA/DBA.php:1.5 Fri Jul 5 23:46:17 2002 +++ pear/DB_DBA/DBA.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA.php,v 1.5 2002/07/06 03:46:17 busterb Exp $ +// $Id: DBA.php,v 1.6 2002/07/06 22:57:02 busterb Exp $ // class DBA { @@ -24,9 +28,9 @@ * Return a DBA object * * @static - * @version 0.0.12 + * @version 0.0.14 * @param string $driver Type of storage object to return - * @return object DBA storage object by reference + * @return object DBA storage object, returned by reference */ function &create($driver = 'simple') { Index: pear/DB_DBA/DBA_Builtin.php diff -u pear/DB_DBA/DBA_Builtin.php:1.5 pear/DB_DBA/DBA_Builtin.php:1.6 --- pear/DB_DBA/DBA_Builtin.php:1.5 Wed Jul 3 10:51:21 2002 +++ pear/DB_DBA/DBA_Builtin.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Builtin.php,v 1.5 2002/07/03 14:51:21 busterb Exp $ +// $Id: DBA_Builtin.php,v 1.6 2002/07/06 22:57:02 busterb Exp $ require_once 'PEAR.php'; Index: pear/DB_DBA/DBA_Compat.php diff -u pear/DB_DBA/DBA_Compat.php:1.4 pear/DB_DBA/DBA_Compat.php:1.5 --- pear/DB_DBA/DBA_Compat.php:1.4 Wed Jul 3 10:51:21 2002 +++ pear/DB_DBA/DBA_Compat.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Compat.php,v 1.4 2002/07/03 14:51:21 busterb Exp $ +// $Id: DBA_Compat.php,v 1.5 2002/07/06 22:57:02 busterb Exp $ /** * dba compatibility layer @@ -27,7 +31,7 @@ * work. * * @author Brent Cook <busterb@mail.utexas.edu> - * @version 0.0.12 + * @version 0.0.14 * @see PHP dba Documentation */ Index: pear/DB_DBA/DBA_Relational.php diff -u pear/DB_DBA/DBA_Relational.php:1.21 pear/DB_DBA/DBA_Relational.php:1.22 --- pear/DB_DBA/DBA_Relational.php:1.21 Sat Jul 6 16:52:49 2002 +++ pear/DB_DBA/DBA_Relational.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Relational.php,v 1.21 2002/07/06 20:52:49 busterb Exp $ +// $Id: DBA_Relational.php,v 1.22 2002/07/06 22:57:02 busterb Exp $ require_once 'PEAR.php'; require_once 'DB/DBA/DBA_Table.php'; @@ -25,7 +29,7 @@ * a relational database manager for DBM-style databases * * @author Brent Cook <busterb@mail.utexas.edu> - * @version 0.0.12 + * @version 0.0.14 */ class DBA_Relational extends PEAR { Index: pear/DB_DBA/DBA_Simple.php diff -u pear/DB_DBA/DBA_Simple.php:1.11 pear/DB_DBA/DBA_Simple.php:1.12 --- pear/DB_DBA/DBA_Simple.php:1.11 Sat Jul 6 00:03:59 2002 +++ pear/DB_DBA/DBA_Simple.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Simple.php,v 1.11 2002/07/06 04:03:59 busterb Exp $ +// $Id: DBA_Simple.php,v 1.12 2002/07/06 22:57:02 busterb Exp $ require_once 'PEAR.php'; @@ -71,7 +75,7 @@ * The sync function calls fflush on the data and index files. * * @author Brent Cook - * @version 0.0.12 + * @version 0.0.14 * @access public * @package DBA */ Index: pear/DB_DBA/DBA_Table.php diff -u pear/DB_DBA/DBA_Table.php:1.27 pear/DB_DBA/DBA_Table.php:1.28 --- pear/DB_DBA/DBA_Table.php:1.27 Sat Jul 6 17:18:49 2002 +++ pear/DB_DBA/DBA_Table.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Table.php,v 1.27 2002/07/06 21:18:49 busterb Exp $ +// $Id: DBA_Table.php,v 1.28 2002/07/06 22:57:02 busterb Exp $ // require_once 'PEAR.php'; require_once 'DB/DBA/DBA.php'; @@ -39,7 +43,7 @@ * It uses a DBA class as the storage driver. * * @author Brent Cook <busterb@mail.utexas.edu> - * @version 0.0.12 + * @version 0.0.14 */ class DBA_Table extends PEAR { Index: pear/DB_DBA/package.xml diff -u pear/DB_DBA/package.xml:1.5 pear/DB_DBA/package.xml:1.6 --- pear/DB_DBA/package.xml:1.5 Fri Jul 5 15:33:30 2002 +++ pear/DB_DBA/package.xml Sat Jul 6 18:57:02 2002 @@ -6,7 +6,7 @@ <name>DB_DBA</name> <summary>Berkely-style Database Class</summary> <description> - Implements a DBM-style database using either PHP's DBA functions or a simple DBM class written in PHP itself. + Implements a DBM-style database using either PHP's DBA functions or a simple DBM class written in PHP. Also provides a relational database system with support for selects, joins, sorts, projects, multiple tables, type checking, autoincrements and more. </description> <maintainers> @@ -19,16 +19,18 @@ </maintainers> <release> - <license>PHP</license> - <version>0.0.12</version> - <date>2002-07-03</date> - <state>alpha</state> + <license>LGPL</license> + <version>0.0.14</version> + <date>2002-07-06</date> + <state>beta</state> <notes> - * autoincrement/decrement now store their ceiling/floor values - properly. improvments to simple driver - * fixed handling of text and boolean types - * sort, project and unique now work more like static functions; - they no longer require a table to be open + Initial release. Like many things, the documentation is not + completed and expect some changes/additions to the API as I try + building some sample applications with this, discovering what works + and what doesn't. See the test files for hints on usage; the most + useful bit currently is DBA_Relational. It uses DBA_Table which + uses DBA. They build on each other, but can be used individually. + See empSchema and hatSchema for examples of how to create a schema. </notes> <filelist> <dir name="/" baseinstalldir="DB/DBA"> Index: pear/DB_DBA/docs/README.txt diff -u pear/DB_DBA/docs/README.txt:1.1 pear/DB_DBA/docs/README.txt:1.2 --- pear/DB_DBA/docs/README.txt:1.1 Tue Jun 25 07:43:51 2002 +++ pear/DB_DBA/docs/README.txt Sat Jul 6 18:57:03 2002 @@ -1,17 +1,42 @@ -DBA is a set of classes for handling and extending Berkeley DB style databases. It works around some of the quirks in the built-in dba functions in PHP (e.g. gdbm does not support dba_replace), has its own dbm engine for installations where dba support is not included in PHP. +DBA is a set of classes for handling and extending Berkeley DB style +databases. It works around some of the quirks in the built-in dba +functions in PHP (e.g. gdbm does not support dba_replace), has its own +dbm engine for installations where dba support is not included in PHP. + +Berkeley DB style databases are much simpler than the other database +systems that PHP supports. They typically support inserting, removing, +and retreiving data from a file, using a key as a reference. An +advantage of these type databases is that they are file-based. A +database-driven web application can run entirely in PHP without any +external database software. They are also easy to use. The interface is +similar to that of reading and writing a file. The difference is, the +database system keeps track of data by key-value pairs rather than by +location-offset. + +DBA implements all of the basic functionality of a Berkeley database and +adds extra functionality. More complex data models can be created using +DBA_Table and DBA_Relational, which provide the ability to perform +database operations such as selects, joins, sorts and projects on rows +and fields, much like a stand-alone RDBMS. -Berkeley DB style databases are much simpler than the other database systems that PHP supports. They typically support inserting, removing, and retreiving data from a file, using a key as a reference. An advantage of these type databases is that they are file-based. A database-driven web application can run entirely in PHP without any external database software. They are also easy to use. The interface is similar to that of reading and writing a file. The difference is, the database system keeps track of data by key-value pairs rather than by location-offset. - -DBA implements all of the basic functionality of a Berkeley database and adds extra functionality. More complex data models can be created using DBA_Table and DBA_Relational, which provide the ability to perform database operations such as selects, joins, sorts and projects on rows and fields, much like a stand-alone RDBMS. - -DBA objects are generated by calling the static method of class DBA, create(). +DBA objects are generated by calling the static method of class DBA, +create(). require_once 'DB_DBA/DBA.php'; $db = DBA::create($driver); -$driver is a string that describes which database driver to use. DBA can use the built-in dba_ functions of PHP if they are compiled in. See the dba documentation in the PHP manual for more information: http://www.php.net/manual/en/ref.dba.php. If the driver string is set to 'simple' or the dba_ functions are not present, then a built-in driver is used. - -NOTE: The gdbm and db3 drivers appear to work perfectly with DBA. Currently (as of PHP 4.3cvs), db2 causes a segmentation fault when opening a database, and cdb is not very useful due to the fact that it does not support write operations. dbm and ndbm have not been tested with DBA. +$driver is a string that describes which database driver to use. DBA can +use the built-in dba_ functions of PHP if they are compiled in. See the +dba documentation in the PHP manual for more information: +http://www.php.net/manual/en/ref.dba.php. If the driver string is set to +'simple' or the dba_ functions are not present, then a built-in driver +is used. + +NOTE: The gdbm and db3 drivers appear to work perfectly with DBA. +Currently (as of PHP 4.3cvs), db2 causes a segmentation fault when +opening a database, and cdb is not very useful due to the fact that it +does not support write operations. dbm and ndbm have not been tested +with DBA. Once the object is created, a database file can be opened. @@ -43,5 +68,8 @@ To close the database, use $db->close(); DBA supports some additional methods: -$db->sync() synchronizes pending writes to disk (these happen automatically too)$db->exists($key) checks if a key exists +$db->sync() synchronizes pending writes to disk (these happen +automatically too)$db->exists($key) checks if a key exists $db->isOpen(), $db->isWritable(), $db->isReadable() + +DBA is copyright 2002 Brent Cook <busterb@mail.utexas.edu> Index: pear/DB_DBA/tests/benchmark_drivers.php diff -u pear/DB_DBA/tests/benchmark_drivers.php:1.2 pear/DB_DBA/tests/benchmark_drivers.php:1.3 --- pear/DB_DBA/tests/benchmark_drivers.php:1.2 Tue Jun 25 07:43:51 2002 +++ pear/DB_DBA/tests/benchmark_drivers.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: benchmark_drivers.php,v 1.2 2002/06/25 11:43:51 busterb Exp $ +// $Id: benchmark_drivers.php,v 1.3 2002/07/06 22:57:03 busterb Exp $ // ini_set('include_path',ini_get('include_path').':../../'); Index: pear/DB_DBA/tests/test_relational.php diff -u pear/DB_DBA/tests/test_relational.php:1.14 pear/DB_DBA/tests/test_relational.php:1.15 --- pear/DB_DBA/tests/test_relational.php:1.14 Sat Jul 6 17:40:30 2002 +++ pear/DB_DBA/tests/test_relational.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: test_relational.php,v 1.14 2002/07/06 21:40:30 busterb Exp $ +// $Id: test_relational.php,v 1.15 2002/07/06 22:57:03 busterb Exp $ // // test functionality of the dba table layer Index: pear/DB_DBA/tests/test_simple.php diff -u pear/DB_DBA/tests/test_simple.php:1.4 pear/DB_DBA/tests/test_simple.php:1.5 --- pear/DB_DBA/tests/test_simple.php:1.4 Fri Jul 5 23:46:18 2002 +++ pear/DB_DBA/tests/test_simple.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: test_simple.php,v 1.4 2002/07/06 03:46:18 busterb Exp $ +// $Id: test_simple.php,v 1.5 2002/07/06 22:57:03 busterb Exp $ // // test functionality of the simple dba layer Index: pear/DB_DBA/tests/test_table.php diff -u pear/DB_DBA/tests/test_table.php:1.11 pear/DB_DBA/tests/test_table.php:1.12 --- pear/DB_DBA/tests/test_table.php:1.11 Sat Jul 6 16:52:50 2002 +++ pear/DB_DBA/tests/test_table.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: test_table.php,v 1.11 2002/07/06 20:52:50 busterb Exp $ +// $Id: test_table.php,v 1.12 2002/07/06 22:57:03 busterb Exp $ // // test functionality of the dba table layer
Index: pear/DB_DBA/DBA.php diff -u pear/DB_DBA/DBA.php:1.5 pear/DB_DBA/DBA.php:1.6 --- pear/DB_DBA/DBA.php:1.5 Fri Jul 5 23:46:17 2002 +++ pear/DB_DBA/DBA.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA.php,v 1.5 2002/07/06 03:46:17 busterb Exp $ +// $Id: DBA.php,v 1.6 2002/07/06 22:57:02 busterb Exp $ // class DBA { @@ -24,9 +28,9 @@ * Return a DBA object * * @static - * @version 0.0.12 + * @version 0.0.14 * @param string $driver Type of storage object to return - * @return object DBA storage object by reference + * @return object DBA storage object, returned by reference */ function &create($driver = 'simple') { Index: pear/DB_DBA/DBA_Builtin.php diff -u pear/DB_DBA/DBA_Builtin.php:1.5 pear/DB_DBA/DBA_Builtin.php:1.6 --- pear/DB_DBA/DBA_Builtin.php:1.5 Wed Jul 3 10:51:21 2002 +++ pear/DB_DBA/DBA_Builtin.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Builtin.php,v 1.5 2002/07/03 14:51:21 busterb Exp $ +// $Id: DBA_Builtin.php,v 1.6 2002/07/06 22:57:02 busterb Exp $ require_once 'PEAR.php'; Index: pear/DB_DBA/DBA_Compat.php diff -u pear/DB_DBA/DBA_Compat.php:1.4 pear/DB_DBA/DBA_Compat.php:1.5 --- pear/DB_DBA/DBA_Compat.php:1.4 Wed Jul 3 10:51:21 2002 +++ pear/DB_DBA/DBA_Compat.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Compat.php,v 1.4 2002/07/03 14:51:21 busterb Exp $ +// $Id: DBA_Compat.php,v 1.5 2002/07/06 22:57:02 busterb Exp $ /** * dba compatibility layer @@ -27,7 +31,7 @@ * work. * * @author Brent Cook <busterb@mail.utexas.edu> - * @version 0.0.12 + * @version 0.0.14 * @see PHP dba Documentation */ Index: pear/DB_DBA/DBA_Relational.php diff -u pear/DB_DBA/DBA_Relational.php:1.21 pear/DB_DBA/DBA_Relational.php:1.22 --- pear/DB_DBA/DBA_Relational.php:1.21 Sat Jul 6 16:52:49 2002 +++ pear/DB_DBA/DBA_Relational.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Relational.php,v 1.21 2002/07/06 20:52:49 busterb Exp $ +// $Id: DBA_Relational.php,v 1.22 2002/07/06 22:57:02 busterb Exp $ require_once 'PEAR.php'; require_once 'DB/DBA/DBA_Table.php'; @@ -25,7 +29,7 @@ * a relational database manager for DBM-style databases * * @author Brent Cook <busterb@mail.utexas.edu> - * @version 0.0.12 + * @version 0.0.14 */ class DBA_Relational extends PEAR { Index: pear/DB_DBA/DBA_Simple.php diff -u pear/DB_DBA/DBA_Simple.php:1.11 pear/DB_DBA/DBA_Simple.php:1.12 --- pear/DB_DBA/DBA_Simple.php:1.11 Sat Jul 6 00:03:59 2002 +++ pear/DB_DBA/DBA_Simple.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Simple.php,v 1.11 2002/07/06 04:03:59 busterb Exp $ +// $Id: DBA_Simple.php,v 1.12 2002/07/06 22:57:02 busterb Exp $ require_once 'PEAR.php'; @@ -71,7 +75,7 @@ * The sync function calls fflush on the data and index files. * * @author Brent Cook - * @version 0.0.12 + * @version 0.0.14 * @access public * @package DBA */ Index: pear/DB_DBA/DBA_Table.php diff -u pear/DB_DBA/DBA_Table.php:1.27 pear/DB_DBA/DBA_Table.php:1.28 --- pear/DB_DBA/DBA_Table.php:1.27 Sat Jul 6 17:18:49 2002 +++ pear/DB_DBA/DBA_Table.php Sat Jul 6 18:57:02 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: DBA_Table.php,v 1.27 2002/07/06 21:18:49 busterb Exp $ +// $Id: DBA_Table.php,v 1.28 2002/07/06 22:57:02 busterb Exp $ // require_once 'PEAR.php'; require_once 'DB/DBA/DBA.php'; @@ -39,7 +43,7 @@ * It uses a DBA class as the storage driver. * * @author Brent Cook <busterb@mail.utexas.edu> - * @version 0.0.12 + * @version 0.0.14 */ class DBA_Table extends PEAR { Index: pear/DB_DBA/package.xml diff -u pear/DB_DBA/package.xml:1.5 pear/DB_DBA/package.xml:1.6 --- pear/DB_DBA/package.xml:1.5 Fri Jul 5 15:33:30 2002 +++ pear/DB_DBA/package.xml Sat Jul 6 18:57:02 2002 @@ -6,7 +6,7 @@ <name>DB_DBA</name> <summary>Berkely-style Database Class</summary> <description> - Implements a DBM-style database using either PHP's DBA functions or a simple DBM class written in PHP itself. + Implements a DBM-style database using either PHP's DBA functions or a simple DBM class written in PHP. Also provides a relational database system with support for selects, joins, sorts, projects, multiple tables, type checking, autoincrements and more. </description> <maintainers> @@ -19,16 +19,18 @@ </maintainers> <release> - <license>PHP</license> - <version>0.0.12</version> - <date>2002-07-03</date> - <state>alpha</state> + <license>LGPL</license> + <version>0.0.14</version> + <date>2002-07-06</date> + <state>beta</state> <notes> - * autoincrement/decrement now store their ceiling/floor values - properly. improvments to simple driver - * fixed handling of text and boolean types - * sort, project and unique now work more like static functions; - they no longer require a table to be open + Initial release. Like many things, the documentation is not + completed and expect some changes/additions to the API as I try + building some sample applications with this, discovering what works + and what doesn't. See the test files for hints on usage; the most + useful bit currently is DBA_Relational. It uses DBA_Table which + uses DBA. They build on each other, but can be used individually. + See empSchema and hatSchema for examples of how to create a schema. </notes> <filelist> <dir name="/" baseinstalldir="DB/DBA"> Index: pear/DB_DBA/docs/README.txt diff -u pear/DB_DBA/docs/README.txt:1.1 pear/DB_DBA/docs/README.txt:1.2 --- pear/DB_DBA/docs/README.txt:1.1 Tue Jun 25 07:43:51 2002 +++ pear/DB_DBA/docs/README.txt Sat Jul 6 18:57:03 2002 @@ -1,17 +1,42 @@ -DBA is a set of classes for handling and extending Berkeley DB style databases. It works around some of the quirks in the built-in dba functions in PHP (e.g. gdbm does not support dba_replace), has its own dbm engine for installations where dba support is not included in PHP. +DBA is a set of classes for handling and extending Berkeley DB style +databases. It works around some of the quirks in the built-in dba +functions in PHP (e.g. gdbm does not support dba_replace), has its own +dbm engine for installations where dba support is not included in PHP. + +Berkeley DB style databases are much simpler than the other database +systems that PHP supports. They typically support inserting, removing, +and retreiving data from a file, using a key as a reference. An +advantage of these type databases is that they are file-based. A +database-driven web application can run entirely in PHP without any +external database software. They are also easy to use. The interface is +similar to that of reading and writing a file. The difference is, the +database system keeps track of data by key-value pairs rather than by +location-offset. + +DBA implements all of the basic functionality of a Berkeley database and +adds extra functionality. More complex data models can be created using +DBA_Table and DBA_Relational, which provide the ability to perform +database operations such as selects, joins, sorts and projects on rows +and fields, much like a stand-alone RDBMS. -Berkeley DB style databases are much simpler than the other database systems that PHP supports. They typically support inserting, removing, and retreiving data from a file, using a key as a reference. An advantage of these type databases is that they are file-based. A database-driven web application can run entirely in PHP without any external database software. They are also easy to use. The interface is similar to that of reading and writing a file. The difference is, the database system keeps track of data by key-value pairs rather than by location-offset. - -DBA implements all of the basic functionality of a Berkeley database and adds extra functionality. More complex data models can be created using DBA_Table and DBA_Relational, which provide the ability to perform database operations such as selects, joins, sorts and projects on rows and fields, much like a stand-alone RDBMS. - -DBA objects are generated by calling the static method of class DBA, create(). +DBA objects are generated by calling the static method of class DBA, +create(). require_once 'DB_DBA/DBA.php'; $db = DBA::create($driver); -$driver is a string that describes which database driver to use. DBA can use the built-in dba_ functions of PHP if they are compiled in. See the dba documentation in the PHP manual for more information: http://www.php.net/manual/en/ref.dba.php. If the driver string is set to 'simple' or the dba_ functions are not present, then a built-in driver is used. - -NOTE: The gdbm and db3 drivers appear to work perfectly with DBA. Currently (as of PHP 4.3cvs), db2 causes a segmentation fault when opening a database, and cdb is not very useful due to the fact that it does not support write operations. dbm and ndbm have not been tested with DBA. +$driver is a string that describes which database driver to use. DBA can +use the built-in dba_ functions of PHP if they are compiled in. See the +dba documentation in the PHP manual for more information: +http://www.php.net/manual/en/ref.dba.php. If the driver string is set to +'simple' or the dba_ functions are not present, then a built-in driver +is used. + +NOTE: The gdbm and db3 drivers appear to work perfectly with DBA. +Currently (as of PHP 4.3cvs), db2 causes a segmentation fault when +opening a database, and cdb is not very useful due to the fact that it +does not support write operations. dbm and ndbm have not been tested +with DBA. Once the object is created, a database file can be opened. @@ -43,5 +68,8 @@ To close the database, use $db->close(); DBA supports some additional methods: -$db->sync() synchronizes pending writes to disk (these happen automatically too)$db->exists($key) checks if a key exists +$db->sync() synchronizes pending writes to disk (these happen +automatically too)$db->exists($key) checks if a key exists $db->isOpen(), $db->isWritable(), $db->isReadable() + +DBA is copyright 2002 Brent Cook <busterb@mail.utexas.edu> Index: pear/DB_DBA/tests/benchmark_drivers.php diff -u pear/DB_DBA/tests/benchmark_drivers.php:1.2 pear/DB_DBA/tests/benchmark_drivers.php:1.3 --- pear/DB_DBA/tests/benchmark_drivers.php:1.2 Tue Jun 25 07:43:51 2002 +++ pear/DB_DBA/tests/benchmark_drivers.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: benchmark_drivers.php,v 1.2 2002/06/25 11:43:51 busterb Exp $ +// $Id: benchmark_drivers.php,v 1.3 2002/07/06 22:57:03 busterb Exp $ // ini_set('include_path',ini_get('include_path').':../../'); Index: pear/DB_DBA/tests/test_relational.php diff -u pear/DB_DBA/tests/test_relational.php:1.14 pear/DB_DBA/tests/test_relational.php:1.15 --- pear/DB_DBA/tests/test_relational.php:1.14 Sat Jul 6 17:40:30 2002 +++ pear/DB_DBA/tests/test_relational.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: test_relational.php,v 1.14 2002/07/06 21:40:30 busterb Exp $ +// $Id: test_relational.php,v 1.15 2002/07/06 22:57:03 busterb Exp $ // // test functionality of the dba table layer Index: pear/DB_DBA/tests/test_simple.php diff -u pear/DB_DBA/tests/test_simple.php:1.4 pear/DB_DBA/tests/test_simple.php:1.5 --- pear/DB_DBA/tests/test_simple.php:1.4 Fri Jul 5 23:46:18 2002 +++ pear/DB_DBA/tests/test_simple.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: test_simple.php,v 1.4 2002/07/06 03:46:18 busterb Exp $ +// $Id: test_simple.php,v 1.5 2002/07/06 22:57:03 busterb Exp $ // // test functionality of the simple dba layer Index: pear/DB_DBA/tests/test_table.php diff -u pear/DB_DBA/tests/test_table.php:1.11 pear/DB_DBA/tests/test_table.php:1.12 --- pear/DB_DBA/tests/test_table.php:1.11 Sat Jul 6 16:52:50 2002 +++ pear/DB_DBA/tests/test_table.php Sat Jul 6 18:57:03 2002 @@ -1,22 +1,26 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | Copyright (c) 2002 Brent Cook | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Brent Cook <busterb@mail.utexas.edu> | +// | Author: Brent Cook <busterb@mail.utexas.edu> | // +----------------------------------------------------------------------+ // -// $Id: test_table.php,v 1.11 2002/07/06 20:52:50 busterb Exp $ +// $Id: test_table.php,v 1.12 2002/07/06 22:57:03 busterb Exp $ // // test functionality of the dba table layer