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');
14 * @package ActionWebservice
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');
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);
35 trigger_error(Ak
::t('Invalid Web Service driver provided. Available Drivers are: %drivers', array('%drivers'=>join(', ',$this->_available_drivers
))), E_USER_WARNING
);
41 if(method_exists($this->_Client
, 'init')){
42 $args = func_get_args();
43 call_user_func_array(array($this->_Client
, 'init'), $args);
49 return $this->_Client
->hasErrors();
54 return $this->_Client
->getErrors();