Changeset 8905
- Timestamp:
- 05/10/08 23:23:51 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/ckWebServicePlugin/trunk/lib/ckSoapParameterFilter.class.php
r8064 r8905 30 30 $request = $this->getContext()->getRequest(); 31 31 $param = $request->getParameter('param', null, 'ckWebServicePlugin'); 32 $map = sfConfig::get( 'mod_'.$this->getContext()->getModuleName().'_soap_parameter_map_'.$this->getContext()->getActionName());32 $map = sfConfig::get(sprintf('mod_%s_%s_parameter', $this->getContext()->getModuleName(), $this->getContext()->getActionName())); 33 33 34 34 if(is_array($param) && is_array($map)) plugins/ckWebServicePlugin/trunk/lib/controller/ckWebServiceController.class.php
r8900 r8905 31 31 { 32 32 parent::initialize($context); 33 $this->dispatcher->connect('controller.change_action', array($this, 'listenToControllerChangeActionEvent')); 33 34 } 34 35 … … 54 55 $result = sfConfig::get('app_ck_web_service_plugin_render', false); 55 56 56 $result = sfConfig::get( 'mod_'.$this->context->getModuleName().'_soap_render_map_'.$this->context->getActionName(), $result);57 $result = sfConfig::get(sprintf('mod_%s_%s_render', $this->context->getModuleName(), $this->context->getActionName()), $result); 57 58 58 59 return $result; … … 195 196 * Implements the default behavior to get the result of a soap action. 196 197 * 197 * @param sfAction $actionInstance The hookedsfAction instance198 * 199 * @return mixed The result of the hookedsfAction instance198 * @param sfAction $actionInstance A sfAction instance 199 * 200 * @return mixed The result of the sfAction instance 200 201 */ 201 202 public function defaultResultCallback($actionInstance) … … 207 208 { 208 209 // get the default result array key 209 $default_key = sfConfig::get( 'mod_'.$actionInstance->getModuleName().'_soap_return_key_'.$actionInstance->getActionName(), 'result');210 $default_key = sfConfig::get(sprintf('mod_%s_%s_result', $actionInstance->getModuleName(), $actionInstance->getActionName()), 'result'); 210 211 211 212 // if there is only one var stored we return it … … 251 252 } 252 253 } 254 255 /** 256 * Listens to the controller.change_action event. 257 * 258 * @param sfEvent $event An sfEvent instance 259 */ 260 public function listenToControllerChangeActionEvent(sfEvent $event) 261 { 262 if($event->getSubject() === $this && !sfConfig::get(sprintf('mod_%s_%s_enable', $event['module'], $event['action']), false)) 263 { 264 throw new sfError404Exception(sprintf('{%s} SoapFunction \'%s_%s\' not found.', __CLASS__, $event['module'], $event['action'])); 265 } 266 } 253 267 } plugins/ckWebServicePlugin/trunk/lib/task/ckWebServiceGenerateWsdlTask.class.php
r8895 r8905 143 143 $yml[$env] = array(); 144 144 } 145 146 $yml[$env]['soap_parameter_map'] = array(); 147 145 148 146 foreach($class->getMethods() as $method) 149 147 { … … 159 157 if($param_return == null) 160 158 { 159 $yml[$env][$action] = array('enable'=>false); 160 161 161 continue; 162 162 } 163 163 164 $yml[$env][ 'soap_parameter_map'][$action] = array();164 $yml[$env][$action] = array('enable'=>true, 'parameter'=>array(), 'result'=>null, 'render'=>false); 165 165 166 166 $ws_method = new WsdlMethod(); … … 174 174 foreach($param_return['param'] as $param) 175 175 { 176 $yml[$env][ 'soap_parameter_map'][$action][] = $param['name'];176 $yml[$env][$action]['parameter'][] = $param['name']; 177 177 178 178 $ws_method->addParameter($param['type'], $param['name'], $param['desc']); … … 186 186 187 187 // only save if we added something to the configuration 188 if(!empty($yml[$env] ['soap_parameter_map']))188 if(!empty($yml[$env])) 189 189 { 190 190 file_put_contents($module_config, sfYaml::dump($yml));