diff options
author | rojaro <> | 2010-03-29 08:56:17 +0000 |
---|---|---|
committer | rojaro <> | 2010-03-29 08:56:17 +0000 |
commit | d3c7d23f0d446144132cce6ac2a5a8a853cf0700 (patch) | |
tree | e1a521883a2ba711c2dcae60c53ad960bb91300f | |
parent | 7cdd0fea2ae055fd026e4f9925781b72be9120dd (diff) |
fixed another bug in the rpc service
-rw-r--r-- | framework/Web/Services/TRpcService.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/framework/Web/Services/TRpcService.php b/framework/Web/Services/TRpcService.php index 8cc0987c..7310725a 100644 --- a/framework/Web/Services/TRpcService.php +++ b/framework/Web/Services/TRpcService.php @@ -63,14 +63,20 @@ class TRpcService extends TService prado::using($_providerClass); - $_className = ($_pos = strrpos($_providerClass, '.')) !== false ? substr($_providerClass, $_pos + 1) : $_providerClass; - if(!is_subclass_of($_className, self::BASE_API_PROVIDER)) + $_providerClassName = ($_pos = strrpos($_providerClass, '.')) !== false ? substr($_providerClass, $_pos + 1) : $_providerClass; + if(!is_subclass_of($_providerClassName, self::BASE_API_PROVIDER)) throw new TConfigurationException('rpcservice_apiprovider_invalid'); if(($_rpcServerClass = $_properties->remove('server')) === null) $_rpcServerClass = self::BASE_RPC_SERVER; - $_apiProvider = new $_className(new $_rpcServerClass($protocolHandler)); + prado::using($_rpcServerClass); + + $_rpcServerClassName = ($_pos = strrpos($_rpcServerClass, '.')) !== false ? substr($_rpcServerClass, $_pos + 1) : $_rpcServerClass; + if(!is_subclass_of($_rpcServerClassName, self::BASE_RPC_SERVER)) + throw new TConfigurationException('rpcservice_rpcserver_invalid'); + + $_apiProvider = new $_providerClassName(new $_rpcServerClassName($protocolHandler)); $_apiProvider->setId($providerId); foreach($_properties as $_key => $_value) |