cvs: pearweb /include pear-database.php xmlrpc-methods.php
| From: | Stig Bakken | Date: | Wed, 31 Oct 2001 06:21:10 +0000 |
| Subject: | cvs: pearweb /include pear-database.php xmlrpc-methods.php | ||
| Groups: | php.pear.cvs php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1216@lists.php.net to get a copy of this message | ||
ssb Wed Oct 31 01:21:10 2001 EDT
Modified files:
/pearweb/include pear-database.php xmlrpc-methods.php
Log:
* pearweb xmlrpc layer now handles PEAR errors
Index: pearweb/include/pear-database.php
diff -u pearweb/include/pear-database.php:1.27 pearweb/include/pear-database.php:1.28
--- pearweb/include/pear-database.php:1.27 Fri Oct 26 07:45:25 2001
+++ pearweb/include/pear-database.php Wed Oct 31 01:21:10 2001
@@ -460,6 +460,15 @@
// }}}
}
+// {{{ proto array testerror()
+
+function testerror()
+{
+ return new PEAR_Error("this is a test error", -42);
+}
+
+// }}}
+
// {{{ mail_pear_admins()
function mail_pear_admins($subject, $msg, $xhdr = '')
Index: pearweb/include/xmlrpc-methods.php
diff -u pearweb/include/xmlrpc-methods.php:1.6 pearweb/include/xmlrpc-methods.php:1.7
--- pearweb/include/xmlrpc-methods.php:1.6 Fri Oct 26 07:45:25 2001
+++ pearweb/include/xmlrpc-methods.php Wed Oct 31 01:21:10 2001
@@ -39,6 +39,12 @@
} else {
$ret = call_user_func_array($function, $params);
}
+ if (PEAR::isError($ret)) {
+ $arr = (array)$ret;
+ $arr['__PEAR_TYPE__'] = 'error';
+ $arr['__PEAR_ERROR_CLASS__'] = get_class($ret);
+ return $arr;
+ }
/*
ob_start();
var_dump($ret);