summaryrefslogtreecommitdiff
path: root/program/lib/DB/dbase.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib/DB/dbase.php')
-rw-r--r--program/lib/DB/dbase.php70
1 files changed, 35 insertions, 35 deletions
diff --git a/program/lib/DB/dbase.php b/program/lib/DB/dbase.php
index 6026f15ce..25455ccda 100644
--- a/program/lib/DB/dbase.php
+++ b/program/lib/DB/dbase.php
@@ -18,7 +18,7 @@
* @package DB
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
- * @copyright 1997-2005 The PHP Group
+ * @copyright 1997-2007 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id$
* @link http://pear.php.net/package/DB
@@ -39,9 +39,9 @@ require_once 'DB/common.php';
* @package DB
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
- * @copyright 1997-2005 The PHP Group
+ * @copyright 1997-2007 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: @package_version@
+ * @version Release: 1.7.13
* @link http://pear.php.net/package/DB
*/
class DB_dbase extends DB_common
@@ -188,7 +188,7 @@ class DB_dbase extends DB_common
* 'portability' => DB_PORTABILITY_ALL,
* );
*
- * $db =& DB::connect($dsn, $options);
+ * $db = DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
@@ -214,7 +214,7 @@ class DB_dbase extends DB_common
* Turn track_errors on for entire script since $php_errormsg
* is the only way to find errors from the dbase extension.
*/
- ini_set('track_errors', 1);
+ @ini_set('track_errors', 1);
$php_errormsg = '';
if (!file_exists($dsn['database'])) {
@@ -273,7 +273,7 @@ class DB_dbase extends DB_common
{
// emulate result resources
$this->res_row[(int)$this->result] = 0;
- $tmp =& new DB_result($this, $this->result++);
+ $tmp = new DB_result($this, $this->result++);
return $tmp;
}
@@ -326,6 +326,26 @@ class DB_dbase extends DB_common
}
// }}}
+ // {{{ freeResult()
+
+ /**
+ * Deletes the result set and frees the memory occupied by the result set.
+ *
+ * This method is a no-op for dbase, as there aren't result resources in
+ * the same sense as most other database backends.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return bool TRUE on success, FALSE if $result is invalid
+ *
+ * @see DB_result::free()
+ */
+ function freeResult($result)
+ {
+ return true;
+ }
+
+ // }}}
// {{{ numCols()
/**
@@ -368,41 +388,21 @@ class DB_dbase extends DB_common
}
// }}}
- // {{{ quoteSmart()
+ // {{{ quoteBoolean()
/**
- * Formats input so it can be safely used in a query
- *
- * @param mixed $in the data to be formatted
- *
- * @return mixed the formatted data. The format depends on the input's
- * PHP type:
- * + null = the string <samp>NULL</samp>
- * + boolean = <samp>T</samp> if true or
- * <samp>F</samp> if false. Use the <kbd>Logical</kbd>
- * data type.
- * + integer or double = the unquoted number
- * + other (including strings and numeric strings) =
- * the data with single quotes escaped by preceeding
- * single quotes then the whole string is encapsulated
- * between single quotes
+ * Formats a boolean value for use within a query in a locale-independent
+ * manner.
*
+ * @param boolean the boolean value to be quoted.
+ * @return string the quoted string.
* @see DB_common::quoteSmart()
- * @since Method available since Release 1.6.0
+ * @since Method available since release 1.7.8.
*/
- function quoteSmart($in)
- {
- if (is_int($in) || is_double($in)) {
- return $in;
- } elseif (is_bool($in)) {
- return $in ? 'T' : 'F';
- } elseif (is_null($in)) {
- return 'NULL';
- } else {
- return "'" . $this->escapeSimple($in) . "'";
- }
+ function quoteBoolean($boolean) {
+ return $boolean ? 'T' : 'F';
}
-
+
// }}}
// {{{ tableInfo()