cvs: pear /MDB MDB.php common.php driver_test.php lob.php manager_common.php manager_pgsql.php metabase_wrapper.php mysql.php pear_wrapper.php
pgsql.php

From: Date: Mon, 12 Aug 2002 12:37:37 +0000
Subject: cvs: pear /MDB MDB.php common.php driver_test.php lob.php manager_common.php manager_pgsql.php metabase_wrapper.php mysql.php pear_wrapper.php
pgsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5705@lists.php.net to get a copy of this message
lsmith Mon Aug 12 08:37:37 2002 EDT Modified files: /pear/MDB pgsql.php pear_wrapper.php mysql.php metabase_wrapper.php MDB.php manager_pgsql.php manager_common.php lob.php driver_test.php common.php Log: minor updates: mainly related to phpdocumentor issues

Index: pear/MDB/pgsql.php diff -u pear/MDB/pgsql.php:1.26 pear/MDB/pgsql.php:1.27 --- pear/MDB/pgsql.php:1.26 Sun Aug 11 07:41:41 2002 +++ pear/MDB/pgsql.php Mon Aug 12 08:37:36 2002 @@ -42,7 +42,12 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.26 2002/08/11 11:41:41 lsmith Exp $ +// $Id: pgsql.php,v 1.27 2002/08/12 12:37:36 lsmith Exp $ + +if (!defined('MDB_PGSQL_INCLUDED')) { + define('MDB_PGSQL_INCLUDED', 1); + +require_once (dirname(__FILE__).'/common.php'); /** * MDB PostGreSQL driver @@ -50,11 +55,6 @@ * @package MDB * @author Paul Cooper <pgc@ucecom.com> */ - -if (!defined('MDB_PGSQL_INCLUDED')) { - define('MDB_PGSQL_INCLUDED', 1); - -require_once (dirname(__FILE__) . '/common.php'); class MDB_driver_pgsql extends MDB_common { var $connection = 0; Index: pear/MDB/pear_wrapper.php diff -u pear/MDB/pear_wrapper.php:1.17 pear/MDB/pear_wrapper.php:1.18 --- pear/MDB/pear_wrapper.php:1.17 Tue Jul 30 15:14:26 2002 +++ pear/MDB/pear_wrapper.php Mon Aug 12 08:37:36 2002 @@ -42,17 +42,17 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: pear_wrapper.php,v 1.17 2002/07/30 19:14:26 lsmith Exp $ +// $Id: pear_wrapper.php,v 1.18 2002/08/12 12:37:36 lsmith Exp $ // +require_once (dirname(__FILE__).'/MDB.php'); + /** * Wrapper that makes MDB behave like PEAR DB * * @package MDB * @author Lukas Smith <smith@dybnet.de> */ - -require_once (dirname(__FILE__).'/MDB.php'); class DB { Index: pear/MDB/mysql.php diff -u pear/MDB/mysql.php:1.38 pear/MDB/mysql.php:1.39 --- pear/MDB/mysql.php:1.38 Sun Aug 11 07:43:54 2002 +++ pear/MDB/mysql.php Mon Aug 12 08:37:36 2002 @@ -42,20 +42,20 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.38 2002/08/11 11:43:54 lsmith Exp $ +// $Id: mysql.php,v 1.39 2002/08/12 12:37:36 lsmith Exp $ // +if (!defined('MDB_MYSQL_INCLUDED')) { + define('MDB_MYSQL_INCLUDED', 1); + +require_once (dirname(__FILE__).'/common.php'); + /** * MDB MySQL driver * * @package MDB * @author Lukas Smith <smith@dybnet.de> */ - -if (!defined('MDB_MYSQL_INCLUDED')) { - define('MDB_MYSQL_INCLUDED', 1); - -require_once (dirname(__FILE__).'/common.php'); class MDB_driver_mysql extends MDB_common { Index: pear/MDB/metabase_wrapper.php diff -u pear/MDB/metabase_wrapper.php:1.30 pear/MDB/metabase_wrapper.php:1.31 --- pear/MDB/metabase_wrapper.php:1.30 Sun Aug 11 07:44:30 2002 +++ pear/MDB/metabase_wrapper.php Mon Aug 12 08:37:36 2002 @@ -42,17 +42,17 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: metabase_wrapper.php,v 1.30 2002/08/11 11:44:30 lsmith Exp $ +// $Id: metabase_wrapper.php,v 1.31 2002/08/12 12:37:36 lsmith Exp $ // +require_once(dirname(__FILE__).'/MDB.php'); + /** * Wrapper that makes MDB behave like Metabase * * @package MDB * @author Lukas Smith <smith@dybnet.de> */ - -require_once(dirname(__FILE__).'/MDB.php'); $metabase_databases = &$databases; $metabases_lobs = &$lobs; Index: pear/MDB/MDB.php diff -u pear/MDB/MDB.php:1.27 pear/MDB/MDB.php:1.28 --- pear/MDB/MDB.php:1.27 Sun Aug 11 07:47:09 2002 +++ pear/MDB/MDB.php Mon Aug 12 08:37:36 2002 @@ -42,38 +42,8 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: MDB.php,v 1.27 2002/08/11 11:47:09 lsmith Exp $ +// $Id: MDB.php,v 1.28 2002/08/12 12:37:36 lsmith Exp $ // - -/** - * The main 'MDB' class is simply a container class with some static - * methods for creating DB objects as well as some utility functions - * common to all parts of DB. - * - * The object model of DB is as follows (indentation means inheritance): - * - * MDB The main DB class. This is simply a utility class - * with some 'static' methods for creating MDB objects as - * well as common utility functions for other MDB classes. - * - * MDB_common The base for each DB implementation. Provides default - * | implementations (in OO lingo virtual methods) for - * | the actual DB implementations as well as a bunch of - * | query utility functions. - * | - * +-MDB_driver_mysql The DB implementation for MySQL. Inherits MDB_Common. - * When calling MDB::factory or MDB::connect for MySQL - * connections, the object returned is an instance of this - * class. - * +-MDB_driver_pgsql The DB implementation for PostGreSQL. Inherits MDB_Common. - * When calling MDB::factory or MDB::connect for PostGreSQL - * connections, the object returned is an instance of this - * class. - * - * @package MDB - * @author Lukas Smith <smith@dybnet.de> - */ - require_once 'PEAR.php'; /** @@ -178,12 +148,6 @@ define('DB_FETCHMODE_ASSOC', 2); /** - * Column data as object properties - */ - -define('DB_FETCHMODE_OBJECT', 3); - -/** * For multi-dimensional results: normally the first level of arrays * is the row number, and the second level indexed by column number or name. * DB_FETCHMODE_FLIPPED switches this order, so the first level of arrays @@ -213,6 +177,35 @@ */ define('DB_AUTOQUERY_INSERT', 1); define('DB_AUTOQUERY_UPDATE', 2); + +/** + * The main 'MDB' class is simply a container class with some static + * methods for creating DB objects as well as some utility functions + * common to all parts of DB. + * + * The object model of DB is as follows (indentation means inheritance): + * + * MDB The main DB class. This is simply a utility class + * with some 'static' methods for creating MDB objects as + * well as common utility functions for other MDB classes. + * + * MDB_common The base for each DB implementation. Provides default + * | implementations (in OO lingo virtual methods) for + * | the actual DB implementations as well as a bunch of + * | query utility functions. + * | + * +-MDB_driver_mysql The DB implementation for MySQL. Inherits MDB_Common. + * When calling MDB::factory or MDB::connect for MySQL + * connections, the object returned is an instance of this + * class. + * +-MDB_driver_pgsql The DB implementation for PostGreSQL. Inherits MDB_Common. + * When calling MDB::factory or MDB::connect for PostGreSQL + * connections, the object returned is an instance of this + * class. + * + * @package MDB + * @author Lukas Smith <smith@dybnet.de> + */ class MDB { Index: pear/MDB/manager_pgsql.php diff -u pear/MDB/manager_pgsql.php:1.18 pear/MDB/manager_pgsql.php:1.19 --- pear/MDB/manager_pgsql.php:1.18 Sun Aug 11 07:47:23 2002 +++ pear/MDB/manager_pgsql.php Mon Aug 12 08:37:36 2002 @@ -42,18 +42,18 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: manager_pgsql.php,v 1.18 2002/08/11 11:47:23 lsmith Exp $ +// $Id: manager_pgsql.php,v 1.19 2002/08/12 12:37:36 lsmith Exp $ +if (!defined('MDB_MANAGER_PGSQL_INCLUDED')) { + define('MDB_MANAGER_PGSQL_INCLUDED', 1); + /** * MDB MySQL driver for the management extensions * * @package MDB * @author Paul Cooper <pgc@ucecom.com> */ - -if (!defined('MDB_MANAGER_PGSQL_INCLUDED')) { - define('MDB_MANAGER_PGSQL_INCLUDED', 1); class MDB_manager_pgsql_class extends MDB_manager_common { Index: pear/MDB/manager_common.php diff -u pear/MDB/manager_common.php:1.17 pear/MDB/manager_common.php:1.18 --- pear/MDB/manager_common.php:1.17 Sun Aug 11 07:47:43 2002 +++ pear/MDB/manager_common.php Mon Aug 12 08:37:36 2002 @@ -42,20 +42,19 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: manager_common.php,v 1.17 2002/08/11 11:47:43 lsmith Exp $ +// $Id: manager_common.php,v 1.18 2002/08/12 12:37:36 lsmith Exp $ // +if(!defined('MDB_MANAGER_COMMON_INCLUDED')) +{ + define('MDB_MANAGER_COMMON_INCLUDED',1); + /** * Base class for the management extensions that is extended by each DB driver * * @package MDB * @author Lukas Smith <smith@dybnet.de> */ - -if(!defined('MDB_MANAGER_COMMON_INCLUDED')) -{ - define('MDB_MANAGER_COMMON_INCLUDED',1); - class MDB_manager_common extends PEAR { Index: pear/MDB/lob.php diff -u pear/MDB/lob.php:1.13 pear/MDB/lob.php:1.14 --- pear/MDB/lob.php:1.13 Sun Aug 11 07:50:20 2002 +++ pear/MDB/lob.php Mon Aug 12 08:37:36 2002 @@ -42,21 +42,21 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: lob.php,v 1.13 2002/08/11 11:50:20 lsmith Exp $ +// $Id: lob.php,v 1.14 2002/08/12 12:37:36 lsmith Exp $ // +if(!defined('MDB_LOB_INCLUDED')) +{ + define('MDB_LOB_INCLUDED', 1); + +require_once 'PEAR.php'; + /** * MDB Large Object (BLOB/CLOB) classes * * @package MDB * @author Lukas Smith <smith@dybnet.de> */ - -require_once 'PEAR.php'; - -if(!defined('MDB_LOB_INCLUDED')) -{ - define('MDB_LOB_INCLUDED', 1); class MDB_lob extends PEAR { Index: pear/MDB/driver_test.php diff -u pear/MDB/driver_test.php:1.11 pear/MDB/driver_test.php:1.12 --- pear/MDB/driver_test.php:1.11 Sun Aug 11 07:50:44 2002 +++ pear/MDB/driver_test.php Mon Aug 12 08:37:36 2002 @@ -42,9 +42,12 @@ // | Authors: Manuel Lemos <mlemos@acm.org> | // +----------------------------------------------------------------------+ // -// $Id: driver_test.php,v 1.11 2002/08/11 11:50:44 lsmith Exp $ +// $Id: driver_test.php,v 1.12 2002/08/12 12:37:36 lsmith Exp $ // +require(dirname(__FILE__).'/metabase_wrapper.php'); +require(dirname(__FILE__).'/manager.php'); + /** * Metabase test suite * This is a script intended to be used by Metabase DBMS driver class @@ -67,10 +70,6 @@ * @package MDB * @author Manuel Lemos <mlemos@acm.org>> */ - -require("metabase_wrapper.php"); -require("manager.php"); -require("lob.php"); Function VerifyFetchedValues($database,$result,$row,&$data,&$value,&$field) { Index: pear/MDB/common.php diff -u pear/MDB/common.php:1.44 pear/MDB/common.php:1.45 --- pear/MDB/common.php:1.44 Sun Aug 11 07:48:50 2002 +++ pear/MDB/common.php Mon Aug 12 08:37:36 2002 @@ -42,14 +42,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: common.php,v 1.44 2002/08/11 11:48:50 lsmith Exp $ - -/** - * MDB_common: Base class that is extended by each DB driver - * - * @package MDB - * @author Lukas Smith <smith@dybnet.de> - */ +// $Id: common.php,v 1.45 2002/08/12 12:37:36 lsmith Exp $ require_once 'PEAR.php'; @@ -64,6 +57,11 @@ define('MDB_TYPE_CLOB', 8); define('MDB_TYPE_BLOB', 9); +/** + * @package MDB + * @author Lukas Smith <smith@dybnet.de> + */ + $registered_transactions_shutdown = 0; // }}} @@ -208,6 +206,13 @@ return mktime ($hour, $minute, $second, $month, $day, $year); } +/** + * MDB_common: Base class that is extended by each DB driver + * + * @package MDB + * @author Lukas Smith <smith@dybnet.de> + */ + class MDB_common extends PEAR { var $database = 0; var $host = ''; @@ -3792,6 +3797,7 @@ return $this->raiseError(DB_ERROR_TRUNCATED); } } + $all = array(); while (is_array($res = $this->fetchInto($result, $fetchmode, NULL))) { if ($rekey) { if ($fetchmode == DB_FETCHMODE_ASSOC) { @@ -4407,6 +4413,10 @@ */ function createLob($arguments) { + $result = $this->loadLob('Create LOB'); + if (MDB::isError($result)) { + return ($result); + } $class_name = 'MDB_lob'; if (isset($arguments['Type'])) { switch ($arguments['Type']) { @@ -4453,7 +4463,7 @@ * MDB::createLob() method. * @param string $data reference to a variable that will hold data * to be read from the large object input stream - * @paraminteger $length value that indicates the largest ammount ofdata + * @param integer $length value that indicates the largest ammount ofdata * to be read from the large object input stream. * @return mixed the effective number of bytes read from the large object * input stream on sucess or an MDB error object.
« previous php.pear.cvs (#5705) next »