Fixes #149
[akelos.git] / lib / AkActionWebService / AkActionWebServiceClient.php
blob5cfd9d08ec06c1eabef8f83b9365052a13b97474
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4 // +----------------------------------------------------------------------+
5 // | Akelos Framework - http://www.akelos.org |
6 // +----------------------------------------------------------------------+
7 // | Copyright (c) 2002-2006, Akelos Media, S.L. & Bermi Ferrer Martinez |
8 // | Released under the GNU Lesser General Public License, see LICENSE.txt|
9 // +----------------------------------------------------------------------+
11 require_once(AK_LIB_DIR.DS.'AkInflector.php');
13 /**
14 * @package ActionWebservice
15 * @subpackage Client
16 * @author Bermi Ferrer <bermi a.t akelos c.om>
17 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
18 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
21 class AkActionWebServiceClient extends AkObject
23 var $_available_drivers = array('xml_rpc');
24 var $_Client;
26 function __construct($client_driver)
28 $client_driver = AkInflector::underscore($client_driver);
29 if(in_array($client_driver, $this->_available_drivers)){
30 $client_class_name = 'Ak'.AkInflector::camelize($client_driver).'Client';
31 require_once(AK_LIB_DIR.DS.'AkActionWebService'.DS.'Clients'.DS.$client_class_name.'.php');
32 $this->_Client =& new $client_class_name($this);
34 }else {
35 trigger_error(Ak::t('Invalid Web Service driver provided. Available Drivers are: %drivers', array('%drivers'=>join(', ',$this->_available_drivers))), E_USER_WARNING);
39 function init()
41 if(method_exists($this->_Client, 'init')){
42 $args = func_get_args();
43 call_user_func_array(array($this->_Client, 'init'), $args);
47 function hasErrors()
49 return $this->_Client->hasErrors();
52 function getErrors()
54 return $this->_Client->getErrors();