Fixes unit tests. unit.php did not run AkActiveRecord _partial-tests.
[akelos.git] / lib / AkActionWebService.php
blobfe6198219bbe2a16631dbdb8ae6ffd41e61fcd27
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 /**
12 * @package ActionWebservice
13 * @subpackage Base
14 * @author Bermi Ferrer <bermi a.t akelos c.om>
15 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
16 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
19 class AkActionWebService extends AkObject
21 var $_apis = array();
23 function __construct()
25 $this->_linkWebServiceApis();
28 function _linkWebServiceApis()
30 if(!empty($this->web_service_api)){
31 $this->web_service_api = Ak::toArray($this->web_service_api);
32 foreach ($this->web_service_api as $api){
33 $this->_linkWebServiceApi($api);
38 function _linkWebServiceApi($api)
40 $api_path = AkInflector::underscore($api);
41 if(substr($api_path,-4) != '_api'){
42 $api_name_space = $api_path;
43 $api_path = $api_path.'_api';
44 }else{
45 $api_name_space = substr($api_path,0,-4);
47 $api_class_name = AkInflector::camelize($api_path);
49 require_once(AK_LIB_DIR.DS.'AkActionWebService'.DS.'AkActionWebServiceApi.php');
50 require_once(AK_APIS_DIR.DS.$api_path.'.php');
52 $this->_apis[$api_name_space] =& new $api_class_name;
55 function &getApis()
57 return $this->_apis;