case 'array':
$arr = array();
- foreach($xmlrpcVal as $value) {
+ foreach ($xmlrpcVal as $value) {
$arr[] = $this->decode($value, $options);
}
return $arr;
} else {
$arr = array();
- foreach($phpVal as $k => $v) {
+ foreach ($phpVal as $k => $v) {
$arr[$k] = $this->encode($v, $options);
}
$xmlrpcVal = new Value($arr, Value::$xmlrpcStruct);
*/
protected function buildConversionTable($tableName)
{
- switch($tableName) {
+ switch ($tableName) {
case 'xml_iso88591_Entities':
if (count($this->xml_iso88591_Entities['in'])) {
return;
* @todo if $debug is 0, we could avoid populating 'raw_data' and 'headers' in the returned value - even better, have
* 2 debug levels
*/
- public function parseResponseHeaders(&$data, $headersProcessed = false, $debug=0)
+ public function parseResponseHeaders(&$data, $headersProcessed = false, $debug = 0)
{
$httpResponse = array('raw_data' => $data, 'headers'=> array(), 'cookies' => array(), 'status_code' => null);
if ($httpResponse['status_code'] !== '200') {
$errstr = substr($data, 0, strpos($data, "\n") - 1);
Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': HTTP error, got response: ' . $errstr);
- throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (' . $errstr . ')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code'] );
+ throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (' . $errstr . ')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code']);
}
// be tolerant to usage of \n instead of \r\n to separate headers and data
// be tolerant to line endings, and extra empty lines
$ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos)));
- foreach($ar as $line) {
+ foreach ($ar as $line) {
// take care of multi-line headers and cookies
$arr = explode(':', $line, 2);
if (count($arr) > 1) {
xml_set_object($parser, $this);
- switch($returnType) {
+ switch ($returnType) {
case self::RETURN_PHP:
xml_set_element_handler($parser, 'xmlrpc_se', 'xmlrpc_ee_fast');
break;
{
//trigger_error('getting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED);
- switch($name) {
+ switch ($name) {
case 'hdrs':
return $this->httpResponse['headers'];
case '_cookies':
{
//trigger_error('setting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED);
- switch($name) {
+ switch ($name) {
case 'hdrs':
$this->httpResponse['headers'] = $value;
break;
public function __isset($name)
{
- switch($name) {
+ switch ($name) {
case 'hdrs':
return isset($this->httpResponse['headers']);
case '_cookies':
public function __unset($name)
{
- switch($name) {
+ switch ($name) {
case 'hdrs':
unset($this->httpResponse['headers']);
break;
}
$req = new Request($methName->scalarval());
- foreach($params as $i => $param) {
+ foreach ($params as $i => $param) {
if (!$req->addParam($param)) {
$i++; // for error message, we count params from 1
return static::_xmlrpcs_multicall_error(new Response(0,
// let accept a plain list of php parameters, beside a single xmlrpc msg object
if (is_object($req)) {
$calls = $req->getParam(0);
- foreach($calls as $call) {
+ foreach ($calls as $call) {
$result[] = static::_xmlrpcs_multicall_do_call($server, $call);
}
} else {
return;
}
- //if($errCode != E_NOTICE && $errCode != E_WARNING && $errCode != E_USER_NOTICE && $errCode != E_USER_WARNING)
+ //if ($errCode != E_NOTICE && $errCode != E_WARNING && $errCode != E_USER_NOTICE && $errCode != E_USER_WARNING)
if ($errCode != E_STRICT) {
\PhpXmlRpc\Server::error_occurred($errString);
}
}
}
// shall we exclude functions returning by ref?
- // if($func->returnsReference())
+ // if ($func->returnsReference())
// return false;
$code = "function $newFuncName(\$req) {\n" . $innerCode . "\n}";
}
$xmlrpcArgs = array();
- foreach($currentArgs as $i => $arg) {
+ foreach ($currentArgs as $i => $arg) {
if ($i == $maxArgs) {
break;
}
*
* @return string
*/
- protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\' )
+ protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\')
{
$code = "\$client = new {$namespace}Client('" . str_replace("'", "\'", $client->path) .
"', '" . str_replace("'", "\'", $client->server) . "', $client->port);\n";