cvs: php4 /pear DB.php PEAR.php.in /pear/DB mysql.php
| From: | Stig Bakken | Date: | Sun, 15 Oct 2000 09:02:54 +0000 |
| Subject: | cvs: php4 /pear DB.php PEAR.php.in /pear/DB mysql.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2060@lists.php.net to get a copy of this message | ||
ssb Sun Oct 15 02:02:54 2000 EDT
Modified files:
/php4/pear DB.php PEAR.php.in
/php4/pear/DB mysql.php
Log:
PEAR DB: added DB_ERROR_VALUE_COUNT_ON_ROW
Index: php4/pear/DB.php
diff -u php4/pear/DB.php:1.33 php4/pear/DB.php:1.34
--- php4/pear/DB.php:1.33 Sat Oct 14 19:22:25 2000
+++ php4/pear/DB.php Sun Oct 15 02:02:54 2000
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.33 2000/10/15 02:22:25 ssb Exp $
+// $Id: DB.php,v 1.34 2000/10/15 09:02:54 ssb Exp $
//
// Database independent query interface.
//
@@ -31,28 +31,29 @@
* If you add an error code here, make sure you also add a textual
* version of it in DB::errorMessage().
*/
-define("DB_OK", 0);
-define("DB_ERROR", -1);
-define("DB_ERROR_SYNTAX", -2);
-define("DB_ERROR_CONSTRAINT", -3);
-define("DB_ERROR_NOT_FOUND", -4);
-define("DB_ERROR_ALREADY_EXISTS", -5);
-define("DB_ERROR_UNSUPPORTED", -6);
-define("DB_ERROR_MISMATCH", -7);
-define("DB_ERROR_INVALID", -8);
-define("DB_ERROR_NOT_CAPABLE", -9);
-define("DB_ERROR_TRUNCATED", -10);
-define("DB_ERROR_INVALID_NUMBER", -11);
-define("DB_ERROR_INVALID_DATE", -12);
-define("DB_ERROR_DIVZERO", -13);
-define("DB_ERROR_NODBSELECTED", -14);
-define("DB_ERROR_CANNOT_CREATE", -15);
-define("DB_ERROR_CANNOT_DELETE", -16);
-define("DB_ERROR_CANNOT_DROP", -17);
-define("DB_ERROR_NOSUCHTABLE", -18);
-define("DB_ERROR_NOSUCHFIELD", -19);
-define("DB_ERROR_NEED_MORE_DATA", -20);
-define("DB_ERROR_NOT_LOCKED", -21);
+define("DB_OK", 0);
+define("DB_ERROR", -1);
+define("DB_ERROR_SYNTAX", -2);
+define("DB_ERROR_CONSTRAINT", -3);
+define("DB_ERROR_NOT_FOUND", -4);
+define("DB_ERROR_ALREADY_EXISTS", -5);
+define("DB_ERROR_UNSUPPORTED", -6);
+define("DB_ERROR_MISMATCH", -7);
+define("DB_ERROR_INVALID", -8);
+define("DB_ERROR_NOT_CAPABLE", -9);
+define("DB_ERROR_TRUNCATED", -10);
+define("DB_ERROR_INVALID_NUMBER", -11);
+define("DB_ERROR_INVALID_DATE", -12);
+define("DB_ERROR_DIVZERO", -13);
+define("DB_ERROR_NODBSELECTED", -14);
+define("DB_ERROR_CANNOT_CREATE", -15);
+define("DB_ERROR_CANNOT_DELETE", -16);
+define("DB_ERROR_CANNOT_DROP", -17);
+define("DB_ERROR_NOSUCHTABLE", -18);
+define("DB_ERROR_NOSUCHFIELD", -19);
+define("DB_ERROR_NEED_MORE_DATA", -20);
+define("DB_ERROR_NOT_LOCKED", -21);
+define("DB_ERROR_VALUE_COUNT_ON_ROW", -22);
/*
@@ -243,28 +244,29 @@
function errorMessage($value) {
if (!isset($errorMessages)) {
$errorMessages = array(
- DB_ERROR => "unknown error",
- DB_ERROR_ALREADY_EXISTS => "already exists",
- DB_ERROR_CANNOT_CREATE => "can not create",
- DB_ERROR_CANNOT_DELETE => "can not delete",
- DB_ERROR_CANNOT_DROP => "can not drop",
- DB_ERROR_CONSTRAINT => "constraint violation",
- DB_ERROR_DIVZERO => "division by zero",
- DB_ERROR_INVALID => "invalid",
- DB_ERROR_INVALID_DATE => "invalid date or time",
- DB_ERROR_INVALID_NUMBER => "invalid number",
- DB_ERROR_MISMATCH => "mismatch",
- DB_ERROR_NODBSELECTED => "no database selected",
- DB_ERROR_NOSUCHFIELD => "no such field",
- DB_ERROR_NOSUCHTABLE => "no such table",
- DB_ERROR_NOT_CAPABLE => "DB backend not capable",
- DB_ERROR_NOT_FOUND => "not found",
- DB_ERROR_NOT_LOCKED => "not locked",
- DB_ERROR_SYNTAX => "syntax error",
- DB_ERROR_UNSUPPORTED => "not supported",
- DB_OK => "no error",
- DB_WARNING => "unknown warning",
- DB_WARNING_READ_ONLY => "read only"
+ DB_ERROR => "unknown error",
+ DB_ERROR_ALREADY_EXISTS => "already exists",
+ DB_ERROR_CANNOT_CREATE => "can not create",
+ DB_ERROR_CANNOT_DELETE => "can not delete",
+ DB_ERROR_CANNOT_DROP => "can not drop",
+ DB_ERROR_CONSTRAINT => "constraint violation",
+ DB_ERROR_DIVZERO => "division by zero",
+ DB_ERROR_INVALID => "invalid",
+ DB_ERROR_INVALID_DATE => "invalid date or time",
+ DB_ERROR_INVALID_NUMBER => "invalid number",
+ DB_ERROR_MISMATCH => "mismatch",
+ DB_ERROR_NODBSELECTED => "no database selected",
+ DB_ERROR_NOSUCHFIELD => "no such field",
+ DB_ERROR_NOSUCHTABLE => "no such table",
+ DB_ERROR_NOT_CAPABLE => "DB backend not capable",
+ DB_ERROR_NOT_FOUND => "not found",
+ DB_ERROR_NOT_LOCKED => "not locked",
+ DB_ERROR_SYNTAX => "syntax error",
+ DB_ERROR_UNSUPPORTED => "not supported",
+ DB_ERROR_VALUE_COUNT_ON_ROW => "value count on row",
+ DB_OK => "no error",
+ DB_WARNING => "unknown warning",
+ DB_WARNING_READ_ONLY => "read only"
);
}
if (DB::isError($value)) {
Index: php4/pear/PEAR.php.in
diff -u php4/pear/PEAR.php.in:1.8 php4/pear/PEAR.php.in:1.9
--- php4/pear/PEAR.php.in:1.8 Wed Sep 13 04:27:59 2000
+++ php4/pear/PEAR.php.in Sun Oct 15 02:02:54 2000
@@ -17,7 +17,7 @@
// | Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: PEAR.php.in,v 1.8 2000/09/13 11:27:59 ssb Exp $
+// $Id: PEAR.php.in,v 1.9 2000/10/15 09:02:54 ssb Exp $
//
define('PEAR_ERROR_RETURN', 1);
@@ -173,6 +173,8 @@
* PEAR_ERROR_CALLBACK, the callback function or object/method
* tuple.
*
+ * @access public
+ *
*/
function PEAR_Error($message = 'unknown error',
$code = 0,
@@ -223,6 +225,12 @@
// }}}
// {{{ getMode()
+ /**
+ * Get the error mode from an error object.
+ *
+ * @return int error mode
+ * @access public
+ */
function getMode() {
return $this->mode;
}
@@ -230,6 +238,12 @@
// }}}
// {{{ getCallback()
+ /**
+ * Get the callback function/method from an error object.
+ *
+ * @return mixed callback function or object/method array
+ * @access public
+ */
function getCallback() {
return $this->callback;
}
@@ -242,6 +256,7 @@
* Get the error message from an error object.
*
* @return string full error message
+ * @access public
*/
function getMessage ()
{
@@ -257,6 +272,7 @@
* Get error code from an error object
*
* @return int error code
+ * @access public
*/
function getCode()
{
@@ -270,6 +286,7 @@
* Get the name of this error/exception.
*
* @return string error/exception name (type)
+ * @access public
*/
function getType ()
{
@@ -283,6 +300,7 @@
* Get additional debug information supplied by the application.
*
* @return string debug information
+ * @access public
*/
function getDebugInfo ()
{
@@ -295,7 +313,8 @@
/**
* Make a string representation of this object.
*
- * @return string a string with an object "summary"
+ * @return string a string with an object summary
+ * @access public
*/
function toString() {
$modes = array();
Index: php4/pear/DB/mysql.php
diff -u php4/pear/DB/mysql.php:1.27 php4/pear/DB/mysql.php:1.28
--- php4/pear/DB/mysql.php:1.27 Sat Oct 14 19:22:26 2000
+++ php4/pear/DB/mysql.php Sun Oct 15 02:02:54 2000
@@ -67,7 +67,8 @@
1054 => DB_ERROR_NOSUCHFIELD,
1062 => DB_ERROR_ALREADY_EXISTS,
1051 => DB_ERROR_NOSUCHTABLE,
- 1100 => DB_ERROR_NOT_LOCKED
+ 1100 => DB_ERROR_NOT_LOCKED,
+ 1136 => DB_ERROR_VALUE_COUNT_ON_ROW,
);
}