import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -17,7 +17,7 @@
* @subpackage Server
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Server.php 12195 2008-10-30 13:34:35Z matthew $
* @version $Id: Server.php 13223 2008-12-14 11:21:31Z thomas $
*/
/**
@ -25,11 +25,6 @@
*/
require_once 'Zend/Server/Abstract.php';
/**
* Exception this class throws
*/
require_once 'Zend/XmlRpc/Server/Exception.php';
/**
* XMLRPC Request
*/
@ -190,9 +185,9 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
/**
* Proxy calls to system object
*
* @param string $method
* @param array $params
*
* @param string $method
* @param array $params
* @return mixed
* @throws Zend_XmlRpc_Server_Exception
*/
@ -200,6 +195,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
{
$system = $this->getSystem();
if (!method_exists($system, $method)) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Unknown instance method called on server: ' . $method);
}
return call_user_func_array(array($system, $method), $params);
@ -224,6 +220,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
public function addFunction($function, $namespace = '')
{
if (!is_string($function) && !is_array($function)) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Unable to attach function; invalid', 611);
}
@ -236,6 +233,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
$function = (array) $function;
foreach ($function as $func) {
if (!is_string($func) || !function_exists($func)) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Unable to attach function; invalid', 611);
}
$reflection = Zend_Server_Reflection::reflectFunction($func, $argv, $namespace);
@ -264,6 +262,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
{
if (is_string($class) && !class_exists($class)) {
if (!class_exists($class)) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Invalid method class', 610);
}
}
@ -294,6 +293,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
if (empty($fault)) {
$fault = 'Unknown error';
}
require_once 'Zend/XmlRpc/Server/Exception.php';
$fault = new Zend_XmlRpc_Server_Exception($fault, $code);
}
@ -353,6 +353,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
} else {
$type = gettype($definition);
}
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Unable to load server definition; must be an array or Zend_Server_Definition, received ' . $type, 612);
}
@ -415,10 +416,12 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
if (is_string($request) && class_exists($request)) {
$request = new $request();
if (!$request instanceof Zend_XmlRpc_Request) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Invalid request class');
}
$request->setEncoding($this->getEncoding());
} elseif (!$request instanceof Zend_XmlRpc_Request) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Invalid request object');
}
@ -457,7 +460,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
/**
* Retrieve current response class
*
*
* @return string
*/
public function getResponseClass()
@ -467,7 +470,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
/**
* Retrieve dispatch table
*
*
* @return array
*/
public function getDispatchTable()
@ -490,7 +493,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
/**
* Retrieve system object
*
*
* @return Zend_XmlRpc_Server_System
*/
public function getSystem()
@ -500,8 +503,8 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
/**
* Map PHP type to XML-RPC type
*
* @param string $type
*
* @param string $type
* @return string
*/
protected function _fixType($type)
@ -527,6 +530,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
// Check for valid method
if (!$this->_table->hasMethod($method)) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Method "' . $method . '" does not exist', 620);
}
@ -559,6 +563,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
}
}
if (!$matched) {
require_once 'Zend/XmlRpc/Server/Exception.php';
throw new Zend_XmlRpc_Server_Exception('Calling parameters do not match signature', 623);
}
@ -569,7 +574,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract
/**
* Register system methods with the server
*
*
* @return void
*/
protected function _registerSystemMethods()