/** * Execute call * * @param \Comodojo\RpcServer\Request\Parameters $params * * @return string */ public static final function execute($params) { $asked_method = $params->get('method'); $method = $params->methods()->get($asked_method); if (is_null($method)) { throw new RpcException("Method not found", -32601); } return $method->getDescription(); }
/** * Execute call * * @param \Comodojo\RpcServer\Request\Parameters $params * * @return array */ public static final function execute($params) { $asked_method = $params->get('method'); $method = $params->methods()->get($asked_method); if (is_null($method)) { throw new RpcException("Method not found", -32601); } $signatures = $method->getSignatures(); return sizeof($signatures) == 1 ? $signatures[0] : $signatures; }
/** * Execute call * * @param \Comodojo\RpcServer\Request\Parameters $params * * @return array */ public static final function execute($params) { if ($params->protocol() != RpcServer::XMLRPC) { throw new RpcException($params->errors()->get(-31000), -31000); } $boxcarred_requests = $params->get('requests'); $results = array(); foreach ($boxcarred_requests as $position => $request) { $new_parameters = new Parameters($params->capabilities(), $params->methods(), $params->errors(), $params->logger(), $params->protocol()); $results[$position] = self::singleCall($request, $new_parameters); } return $results; }