From 439b0b12dc8f6cbeb769fe4f2c0061ff9d3c9d31 Mon Sep 17 00:00:00 2001 From: carlgmathisen <> Date: Tue, 2 Dec 2008 00:02:51 +0000 Subject: php configuration type --- framework/Web/Services/TSoapService.php | 38 +++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'framework/Web/Services/TSoapService.php') diff --git a/framework/Web/Services/TSoapService.php b/framework/Web/Services/TSoapService.php index 24f95a35..259fa5f8 100644 --- a/framework/Web/Services/TSoapService.php +++ b/framework/Web/Services/TSoapService.php @@ -148,19 +148,35 @@ class TSoapService extends TService /** * Loads configuration from an XML element - * @param TXmlElement configuration node + * @param mixed configuration node * @throws TConfigurationException if soap server id is not specified or duplicated */ - private function loadConfig($xml) - { - foreach($xml->getElementsByTagName('soap') as $serverXML) + private function loadConfig($config) + { + if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP) + { + if(is_array($config)) + { + foreach($config as $id => $server) + { + $properties = isset($server['properties'])?$server['properties']:array(); + if(isset($this->_servers[$id])) + throw new TConfigurationException('soapservice_serverid_duplicated',$id); + $this->_servers[$id]=$properties; + } + } + } + else { - $properties=$serverXML->getAttributes(); - if(($id=$properties->remove('id'))===null) - throw new TConfigurationException('soapservice_serverid_required'); - if(isset($this->_servers[$id])) - throw new TConfigurationException('soapservice_serverid_duplicated',$id); - $this->_servers[$id]=$properties; + foreach($config->getElementsByTagName('soap') as $serverXML) + { + $properties=$serverXML->getAttributes(); + if(($id=$properties->remove('id'))===null) + throw new TConfigurationException('soapservice_serverid_required'); + if(isset($this->_servers[$id])) + throw new TConfigurationException('soapservice_serverid_duplicated',$id); + $this->_servers[$id]=$properties; + } } } @@ -221,7 +237,7 @@ class TSoapService extends TService protected function createServer() { $properties=$this->_servers[$this->_serverID]; - if(($serverClass=$properties->remove('class'))===null) + if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP || ($serverClass=$properties->remove('class'))===null) $serverClass=self::DEFAULT_SOAP_SERVER; Prado::using($serverClass); $className=($pos=strrpos($serverClass,'.'))!==false?substr($serverClass,$pos+1):$serverClass; -- cgit v1.2.3