diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-05-13 06:22:33 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-05-13 06:22:33 +0200 |
commit | 0b59f270a432f8c7b6128981f0a39b4a2e2fbd34 (patch) | |
tree | 1e7655eabd76bb981692f5d4f21cb1fc7be3e9cd /system/libraries/Xmlrpc.php | |
parent | 5cf664748ee295867f593d7eb7991bd35fe8eca6 (diff) |
Some sweeping syntax changes for consistency:
(! foo) changed to ( ! foo)
|| changed to OR
changed newline standardization code in various places from preg_replace to str_replace
Diffstat (limited to 'system/libraries/Xmlrpc.php')
-rw-r--r-- | system/libraries/Xmlrpc.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 32d739689..1748ab833 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -1,4 +1,4 @@ -<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
@@ -13,7 +13,7 @@ * @filesource
*/
-if (! function_exists('xml_parser_create'))
+if ( ! function_exists('xml_parser_create'))
{
show_error('Your PHP installation does not support XML');
}
@@ -159,7 +159,7 @@ class CI_Xmlrpc { $parts = parse_url($url);
- $path = (!isset($parts['path'])) ? '/' : $parts['path'];
+ $path = ( ! isset($parts['path'])) ? '/' : $parts['path'];
if (isset($parts['query']) && $parts['query'] != '')
{
@@ -176,7 +176,7 @@ class CI_Xmlrpc { function timeout($seconds=5)
{
- if (! is_null($this->client) && is_int($seconds))
+ if ( ! is_null($this->client) && is_int($seconds))
{
$this->client->timeout = $seconds;
}
@@ -199,7 +199,7 @@ class CI_Xmlrpc { function request($incoming)
{
- if (! is_array($incoming))
+ if ( ! is_array($incoming))
{
// Send Error
}
@@ -231,7 +231,7 @@ class CI_Xmlrpc { {
if (is_array($value) && isset($value['0']))
{
- if (! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])]))
+ if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])]))
{
if (is_array($value[0]))
{
@@ -275,12 +275,12 @@ class CI_Xmlrpc { $this->message = new XML_RPC_Message($this->method,$this->data);
$this->message->debug = $this->debug;
- if (! $this->result = $this->client->send($this->message))
+ if ( ! $this->result = $this->client->send($this->message))
{
$this->error = $this->result->errstr;
return FALSE;
}
- elseif(! is_object($this->result->val))
+ elseif( ! is_object($this->result->val))
{
$this->error = $this->result->errstr;
return FALSE;
@@ -384,7 +384,7 @@ class XML_RPC_Client extends CI_Xmlrpc {
$fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstr, $this->timeout);
- if (! is_resource($fp))
+ if ( ! is_resource($fp))
{
error_log($this->xmlrpcstr['http_error']);
$r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'],$this->xmlrpcstr['http_error']);
@@ -406,7 +406,7 @@ class XML_RPC_Client extends CI_Xmlrpc $op .= $msg->payload;
- if (!fputs($fp, $op, strlen($op)))
+ if ( ! fputs($fp, $op, strlen($op)))
{
error_log($this->xmlrpcstr['http_error']);
$r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']);
@@ -442,7 +442,7 @@ class XML_RPC_Response $this->errno = $code;
$this->errstr = htmlentities($fstr);
}
- else if (!is_object($val))
+ else if ( ! is_object($val))
{
// programmer error, not an object
error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to XML_RPC_Response. Defaulting to empty value.");
@@ -737,7 +737,7 @@ class XML_RPC_Message extends CI_Xmlrpc // PARSE XML DATA
//-------------------------------------
- if (!xml_parse($parser, $data, sizeof($data)))
+ if ( ! xml_parse($parser, $data, sizeof($data)))
{
$errstr = sprintf('XML error: %s at line %d',
xml_error_string(xml_get_error_code($parser)),
@@ -765,7 +765,7 @@ class XML_RPC_Message extends CI_Xmlrpc $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']);
return $r;
}
- elseif (! is_object($this->xh[$parser]['value']))
+ elseif ( ! is_object($this->xh[$parser]['value']))
{
$r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']);
return $r;
@@ -862,7 +862,7 @@ class XML_RPC_Message extends CI_Xmlrpc else
{
// not top level element: see if parent is OK
- if (!in_array($this->xh[$the_parser]['stack'][0], $this->valid_parents[$name], TRUE))
+ if ( ! in_array($this->xh[$the_parser]['stack'][0], $this->valid_parents[$name], TRUE))
{
$this->xh[$the_parser]['isf'] = 2;
$this->xh[$the_parser]['isf_reason'] = "XML-RPC element $name cannot be child of ".$this->xh[$the_parser]['stack'][0];
@@ -961,7 +961,7 @@ class XML_RPC_Message extends CI_Xmlrpc case 'STRUCT':
case 'ARRAY':
$cur_val = array_shift($this->xh[$the_parser]['valuestack']);
- $this->xh[$the_parser]['value'] = (! isset($cur_val['values'])) ? array() : $cur_val['values'];
+ $this->xh[$the_parser]['value'] = ( ! isset($cur_val['values'])) ? array() : $cur_val['values'];
$this->xh[$the_parser]['vt'] = strtolower($name);
break;
case 'NAME':
@@ -1005,7 +1005,7 @@ class XML_RPC_Message extends CI_Xmlrpc {
// we have a DOUBLE
// we must check that only 0123456789-.<space> are characters here
- if (! preg_match('/^[+-]?[eE0-9\t \.]+$/', $this->xh[$the_parser]['ac']))
+ if ( ! preg_match('/^[+-]?[eE0-9\t \.]+$/', $this->xh[$the_parser]['ac']))
{
$this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND';
}
@@ -1018,7 +1018,7 @@ class XML_RPC_Message extends CI_Xmlrpc {
// we have an I4/INT
// we must check that only 0123456789-<space> are characters here
- if (! preg_match('/^[+-]?[0-9\t ]+$/', $this->xh[$the_parser]['ac']))
+ if ( ! preg_match('/^[+-]?[0-9\t ]+$/', $this->xh[$the_parser]['ac']))
{
$this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND';
}
@@ -1101,7 +1101,7 @@ class XML_RPC_Message extends CI_Xmlrpc $this->xh[$the_parser]['lv'] = 2; // Found a value
}
- if(! @isset($this->xh[$the_parser]['ac']))
+ if( ! @isset($this->xh[$the_parser]['ac']))
{
$this->xh[$the_parser]['ac'] = '';
}
@@ -1213,7 +1213,7 @@ class XML_RPC_Values extends CI_Xmlrpc {
parent::CI_Xmlrpc();
- if ($val != -1 || $type != '')
+ if ($val != -1 OR $type != '')
{
$type = $type == '' ? 'string' : $type;
@@ -1250,7 +1250,7 @@ class XML_RPC_Values extends CI_Xmlrpc if ($type == $this->xmlrpcBoolean)
{
- if (strcasecmp($val,'true')==0 || $val==1 || ($val==true && strcasecmp($val,'false')))
+ if (strcasecmp($val,'true')==0 OR $val==1 OR ($val==true && strcasecmp($val,'false')))
{
$val = 1;
}
|