phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc/class.db.inc.php, 1.8


From: nomail
Subject: [Phpgroupware-cvs] phpgwapi/inc/class.db.inc.php, 1.8
Date: Thu, 27 May 2004 06:56:25 +0200

Update of /phpgwapi/inc
Modified Files:
        Branch: 
          class.db.inc.php

date: 2004/05/27 04:56:25;  author: skwashd;  state: Exp;  lines: +96 -55

Log Message:
merging 16 changes
=====================================================================
Index: phpgwapi/inc/class.db.inc.php
diff -u phpgwapi/inc/class.db.inc.php:1.7 phpgwapi/inc/class.db.inc.php:1.8
--- phpgwapi/inc/class.db.inc.php:1.7   Thu Oct  9 03:31:32 2003
+++ phpgwapi/inc/class.db.inc.php       Thu May 27 04:56:25 2004
@@ -1,41 +1,34 @@
 <?php
- /**********************************************************************\
- * phpGroupWare - API - Database Abstraction                           *
- * http://www.phpgroupware.org                                         *
- * This program is part of the GNU project, see http://www.gnu.org/    *
- *                                                                     *
- * Portions Copyright 2001, 2002, 2003 Free Software Foundation, Inc.  *
- * Based on phplib - Copyright 1998-2000 NetUSE AG,                    * 
- *                     Boris Erdmann, Kristian Koehntopp               *
- * Contributions from Dan Kuykendall, Dave Hall and others             *
- * --------------------------------------------                                
*
- *  This program 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.                        
*
- \**********************************************************************/
- /* $Id$ */
-  
+       /**
+       * Database abstraction class
+       * @author NetUSE AG Boris Erdmann, Kristian Koehntopp
+       * @author Dan Kuykendall, Dave Hall and others
+       * @copyright Copyright (C) 1998-2000 NetUSE AG Boris Erdmann, Kristian 
Koehntopp
+       * @copyright Portions Copyright (C) 2001-2004 Free Software Foundation, 
Inc. http://www.fsf.org/
+       * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General 
Public License
+       * @link http://www.sanisoft.com/phplib/manual/DB_sql.php
+       * @package phpgwapi
+       * @subpackage database
+       * @version $Id$
+       */
+
        if (empty($GLOBALS['phpgw_info']['server']['db_type']))
        {
                $GLOBALS['phpgw_info']['server']['db_type'] = 'mysql';
        }
+       /**
+       * Include concrete database implementation
+       */
        
include(PHPGW_API_INC.'/class.db_'.$GLOBALS['phpgw_info']['server']['db_type'].'.inc.php');
 
+
        /**
-       * Database abstraction library
+       * Database abstraction class to allow phpGroupWare to use multiple 
database backends
        * 
-       * This allows phpGroupWare to use multiple database backends 
-       *
        * @package phpgwapi
-       * @subpackage db
+       * @subpackage database
        * @abstract
-       * @author NetUSE AG Boris Erdmann, Kristian Koehntopp <br> hacked on by 
phpGW
-       * @copyright &copy; 1998-2000 NetUSE AG Boris Erdmann, Kristian 
Koehntopp <br> 2003 FreeSoftware Foundation
-       * @license LGPL
-       * @link http://www.sanisoft.com/phplib/manual/DB_sql.php
        */
-
        class db_
        {
                /**
@@ -103,20 +96,28 @@
                */
                var $Error    = '';
 
-               //i am not documenting private vars - skwashd :)
+               /** 
+               * @var boolean XMLRPC available
+               * @access  private
+               */
                var $xmlrpc = False;
+               /** 
+               * @var boolean SOAP available
+               * @access  private
+               */
                var $soap   = False;
 
                /**
+               * Constructor
                * @param string $query query to be executed (optional)
                */
- 
                function db_($query = '')
                {
                        $this->query($query);
                }
 
                /**
+               * Get current connection id
                * @return int current connection id
                */
                function link_id()
@@ -125,6 +126,7 @@
                }
 
                /**
+               * Get current query id
                * @return int id of current query
                */
                function query_id()
@@ -138,7 +140,7 @@
                * @param string $Database name of database to use (optional)
                * @param string $Host database host to connect to (optional)
                * @param string $User name of database user (optional)
-               * @var string $Password password for database user (optional)
+               * @param string $Password password for database user (optional)
                */
                function connect($Database = '', $Host = '', $User = '', 
$Password = '')
                {}
@@ -184,6 +186,8 @@
                {}
 
                /**
+               * Execute a query with limited result set
+               * @param integer $start Row to start from
                * @deprecated
                * @see limit_query()
                */
@@ -202,7 +206,7 @@
                * @param string $Query_String the query to be executed
                * @param mixed $line the line method was called from - use 
__LINE__
                * @param string $file the file method was called from - use 
__FILE__
-               * @return int current query id if sucesful and null if fails
+               * @return integer current query id if sucesful and null if fails
                */
                function query($Query_String, $line = '', $file = '')
                {}
@@ -211,11 +215,11 @@
                * Execute a query with limited result set
                *
                * @param string $Query_String the query to be executed
-               * @param int $offset row to start from
-               * @param mixed $line the line method was called from - use 
__LINE__
+               * @param integer $offset row to start from
+               * @param integer $line the line method was called from - use 
__LINE__
                * @param string $file the file method was called from - use 
__FILE__
-               * @param int $num_rows number of rows to return (optional), if 
unset will use 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']
-               * @return int current query id if sucesful and null if fails
+               * @param integer $num_rows number of rows to return (optional), 
if unset will use 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']
+               * @return integer current query id if sucesful and null if fails
                */
                function limit_query($Query_String, $offset, $line = '', $file 
= '', $num_rows = '')
                {}
@@ -238,9 +242,9 @@
                {}
 
                /**
-               * Begin Transaction
+               * Begin transaction
                *
-               * @return int current transaction id
+               * @return integer|boolean current transaction id
                */
                function transaction_begin()
                {
@@ -250,7 +254,7 @@
                /**
                * Complete the transaction
                *
-               * @return bool True if sucessful, False if fails
+               * @return boolean True if sucessful, False if fails
                */ 
                function transaction_commit()
                {
@@ -260,7 +264,7 @@
                /**
                * Rollback the current transaction
                *
-               * @return bool True if sucessful, False if fails
+               * @return boolean True if sucessful, False if fails
                */
                function transaction_abort()
                {
@@ -272,7 +276,7 @@
                *
                * @param string $table name of table the insert was performed on
                * @param string $field the autoincrement primary key of the 
table
-               * @return int the id, -1 if fails
+               * @return integer the id, -1 if fails
                */
                function get_last_insert_id($table, $field)
                {}
@@ -282,7 +286,7 @@
                *
                * @param string $table name of table to lock
                * @param string $mode type of lock required (optional), default 
write
-               * @return bool True if sucessful, False if fails
+               * @return boolean True if sucessful, False if fails
                */
                function lock($table, $mode='write')
                {}
@@ -291,7 +295,7 @@
                /**
                * Unlock a table
                *
-               * @return bool True if sucessful, False if fails
+               * @return boolean True if sucessful, False if fails
                */
                function unlock()
                {}
@@ -299,7 +303,7 @@
                /**
                * Get the number of rows affected by last update
                *
-               * @return int number of rows
+               * @return integer number of rows
                */
                function affected_rows()
                {}
@@ -307,7 +311,7 @@
                /**
                * Number of rows in current result set
                *
-               * @return int number of rows
+               * @return integer number of rows
                */
                function num_rows()
                {}
@@ -315,14 +319,16 @@
                /**
                * Number of fields in current row
                *
-               * @return int number of fields
+               * @return integer number of fields
                */
                
                function num_fields()
                {}
 
                /**
-               * short hand for @see num_rows()
+               * Short hand for num_rows()
+               * @return integer Number of rows
+               * @see num_rows()
                */
                function nf()
                {
@@ -330,7 +336,7 @@
                }
 
                /**
-               * short hand for print @see num_rows
+               * Short hand for print @see num_rows
                */
                function np()
                {
@@ -341,7 +347,7 @@
                * Return the value of a filed
                * 
                * @param string $String name of field
-               * @param bool $strip_slashes string escape chars from 
field(optional), default false
+               * @param boolean $strip_slashes string escape chars from 
field(optional), default false
                * @return string the field value
                */
                function f($Name, $strip_slashes = False)
@@ -371,7 +377,7 @@
                * Get the id for the next sequence - not implemented!
                *
                * @param string $seq_name name of the sequence
-               * @return int sequence id
+               * @return integer sequence id
                */
                function nextid($seq_name)
                {}
@@ -380,10 +386,10 @@
                * Get description of a table
                *
                * @param string $table name of table to describe
-               * @param bool $full optional, default False summary 
information, True full information
-               * @return array table meta data
+               * @param boolean $full optional, default False summary 
information, True full information
+               * @return array Table meta data
                */  
-               function metadata($table='',$full=false)
+               function metadata($table = '',$full = false)
                {
                        /*
                         * Due to compatibility problems with Table we changed 
the behavior
@@ -422,7 +428,7 @@
                function halt($msg, $line = '', $file = '')
                {}
 
-               /**
+               /**
                * Get a list of table names in the current database
                *
                * @return array list of the tables
@@ -433,7 +439,7 @@
                /**
                * Return a list of indexes in current database
                *
-               * @return array list of indexes
+               * @return array List of indexes
                */
                function index_names()
                {
@@ -443,10 +449,45 @@
                /**
                * Create a new database
                *
-               * @param string $adminname name of database administrator user 
(optional)
-               * @param string $adminpasswd password for the database 
administrator user (optional)
+               * @param string $adminname Name of database administrator user 
(optional)
+               * @param string $adminpasswd Password for the database 
administrator user (optional)
                */
                function create_database($adminname = '', $adminpasswd = '')
                {}
+     
+                
+       /**
+                * Prepare SQL statement
+                *
+                * @param string $query SQL query
+                * @return integer|boolean Result identifier for 
query_prepared_statement() or FALSE
+                * @see query_prepared_statement()
+                */
+               function prepare_sql_statement($query)
+               {
+                 if (($query == '') || (!$this->connect()))
+                  {
+                       return(FALSE);
+                  }
+                 return(FALSE);
+               }
+
+        /**
+         * Execute prepared SQL statement
+         *
+         * @param resource $result_id Result identifier from 
prepare_sql_statement()
+         * @param array $parameters_array Parameters for the prepared SQL 
statement
+         * @return boolean TRUE on success or FALSE on failure
+         * @see prepare_sql_statement()
+         */
+        function query_prepared_statement($result_id, $parameters_array)
+         {
+                 if ((!$this->connect()) || (!$result_id))
+                  {
+                       return(FALSE);
+                  }
+                 return(FALSE);
+         }  
+                
        }
 ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]