root/trunk/lib/AkActionWebService/AkActionWebServiceClient.php

Revision 343, 1.9 kB (checked in by bermiferrer, 3 years ago)

Updating ActionWebservice? Client

Line 
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
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 // +----------------------------------------------------------------------+
10
11 require_once(AK_LIB_DIR.DS.'AkInflector.php');
12
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>
19  */
20
21 class AkActionWebServiceClient extends AkObject
22 {
23     var $_available_drivers = array('xml_rpc');
24     var $_Client;
25
26     function __construct($client_driver)
27     {
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);
33
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);
36         }
37     }
38
39     function init()
40     {
41         if(method_exists($this->_Client, 'init')){
42             $args = func_get_args();
43             call_user_func_array(array($this->_Client, 'init'), $args);
44         }
45     }
46     
47     function hasErrors()
48     {
49         return $this->_Client->hasErrors();
50     }
51
52     function getErrors()
53     {
54         return $this->_Client->getErrors();
55     }
56
57     
58 }
59
60 ?>
Note: See TracBrowser for help on using the browser.