7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://framework.zend.com/license/new-bsd
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@zend.com so we can send you a copy immediately.
16
* @package Zend_XmlRpc
18
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
* @license http://framework.zend.com/license/new-bsd New BSD License
24
* The namespace decorator enables object chaining to permit
25
* calling XML-RPC namespaced functions like "foo.bar.baz()"
26
* as "$remote->foo->bar->baz()".
29
* @package Zend_XmlRpc
31
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
32
* @license http://framework.zend.com/license/new-bsd New BSD License
34
class Zend_XmlRpc_Client_ServerProxy
37
* @var Zend_XmlRpc_Client
39
private $_client = null;
44
private $_namespace = '';
48
* @var array of Zend_XmlRpc_Client_ServerProxy
50
private $_cache = array();
56
* @param string $namespace
57
* @param Zend_XmlRpc_Client $client
59
public function __construct($client, $namespace = '')
61
$this->_namespace = $namespace;
62
$this->_client = $client;
67
* Get the next successive namespace
70
* @return Zend_XmlRpc_Client_ServerProxy
72
public function __get($namespace)
74
$namespace = ltrim("$this->_namespace.$namespace", '.');
75
if (!isset($this->_cache[$namespace])) {
76
$this->_cache[$namespace] = new $this($this->_client, $namespace);
78
return $this->_cache[$namespace];
83
* Call a method in this namespace.
85
* @param string $methodN
89
public function __call($method, $args)
91
$method = ltrim("$this->_namespace.$method", '.');
92
return $this->_client->call($method, $args);