OSDN Git Service

FIX: PHP5/MySQL5における文法違反コードの修正
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / libs / xmlrpc.inc.php
index a4798b7..dfc0e36 100755 (executable)
@@ -556,7 +556,7 @@ $cp1252_to_xmlent =
                     if ($rebuild_xmlrpcvals)
                     {
                         // build the xmlrpc val out of the data received, and substitute it
-                        $temp =& new xmlrpcval($GLOBALS['_xh']['value'], $GLOBALS['_xh']['vt']);
+                        $temp = new xmlrpcval($GLOBALS['_xh']['value'], $GLOBALS['_xh']['vt']);
                         // in case we got info about underlying php class, save it
                         // in the object we're rebuilding
                         if (isset($GLOBALS['_xh']['php_class']))
@@ -1119,7 +1119,7 @@ $cp1252_to_xmlent =
             }
             elseif(is_string($msg))
             {
-                $n =& new xmlrpcmsg('');
+                $n = new xmlrpcmsg('');
                 $n->payload = $msg;
                 $msg = $n;
             }
@@ -1345,14 +1345,14 @@ $cp1252_to_xmlent =
             else
             {
                 $this->errstr='Connect error: '.$this->errstr;
-                $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr . ' (' . $this->errno . ')');
+                $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr . ' (' . $this->errno . ')');
                 return $r;
             }
 
             if(!fputs($fp, $op, strlen($op)))
             {
                 $this->errstr='Write error';
-                $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr);
+                $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr);
                 return $r;
             }
             else
@@ -1403,7 +1403,7 @@ $cp1252_to_xmlent =
             if(!function_exists('curl_init'))
             {
                 $this->errstr='CURL unavailable on this install';
-                $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_curl'], $GLOBALS['xmlrpcstr']['no_curl']);
+                $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_curl'], $GLOBALS['xmlrpcstr']['no_curl']);
                 return $r;
             }
             if($method == 'https')
@@ -1412,7 +1412,7 @@ $cp1252_to_xmlent =
                     ((is_string($info) && strpos($info, 'OpenSSL') === null) || (is_array($info) && !isset($info['ssl_version']))))
                 {
                     $this->errstr='SSL unavailable on this install';
-                    $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_ssl'], $GLOBALS['xmlrpcstr']['no_ssl']);
+                    $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_ssl'], $GLOBALS['xmlrpcstr']['no_ssl']);
                     return $r;
                 }
             }
@@ -1625,7 +1625,7 @@ $cp1252_to_xmlent =
             if(!$result)
             {
                 $this->errstr='no response';
-                $resp=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['curl_fail'], $GLOBALS['xmlrpcstr']['curl_fail']. ': '. curl_error($curl));
+                $resp= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['curl_fail'], $GLOBALS['xmlrpcstr']['curl_fail']. ': '. curl_error($curl));
                 if(!$keepalive)
                 {
                     curl_close($curl);
@@ -1695,7 +1695,7 @@ $cp1252_to_xmlent =
                         }
                         else
                         {
-                            $result =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['multicall_error'], $GLOBALS['xmlrpcstr']['multicall_error']);
+                            $result = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['multicall_error'], $GLOBALS['xmlrpcstr']['multicall_error']);
                         }
                     }
                 }
@@ -1742,17 +1742,17 @@ $cp1252_to_xmlent =
             $calls = array();
             foreach($msgs as $msg)
             {
-                $call['methodName'] =& new xmlrpcval($msg->method(),'string');
+                $call['methodName'] = new xmlrpcval($msg->method(),'string');
                 $numParams = $msg->getNumParams();
                 $params = array();
                 for($i = 0; $i < $numParams; $i++)
                 {
                     $params[$i] = $msg->getParam($i);
                 }
-                $call['params'] =& new xmlrpcval($params, 'array');
-                $calls[] =& new xmlrpcval($call, 'struct');
+                $call['params'] = new xmlrpcval($params, 'array');
+                $calls[] = new xmlrpcval($call, 'struct');
             }
-            $multicall =& new xmlrpcmsg('system.multicall');
+            $multicall = new xmlrpcmsg('system.multicall');
             $multicall->addParam(new xmlrpcval($calls, 'array'));
 
             // Attempt RPC call
@@ -1800,7 +1800,7 @@ $cp1252_to_xmlent =
                                 return false;       // Bad value
                             }
                             // Normal return value
-                            $response[$i] =& new xmlrpcresp($val[0], 0, '', 'phpvals');
+                            $response[$i] = new xmlrpcresp($val[0], 0, '', 'phpvals');
                             break;
                         case 2:
                             /// @todo remove usage of @: it is apparently quite slow
@@ -1814,7 +1814,7 @@ $cp1252_to_xmlent =
                             {
                                 return false;
                             }
-                            $response[$i] =& new xmlrpcresp(0, $code, $str);
+                            $response[$i] = new xmlrpcresp(0, $code, $str);
                             break;
                         default:
                             return false;
@@ -1847,7 +1847,7 @@ $cp1252_to_xmlent =
                                 return false;       // Bad value
                             }
                             // Normal return value
-                            $response[$i] =& new xmlrpcresp($val->arraymem(0));
+                            $response[$i] = new xmlrpcresp($val->arraymem(0));
                             break;
                         case 'struct':
                             $code = $val->structmem('faultCode');
@@ -1860,7 +1860,7 @@ $cp1252_to_xmlent =
                             {
                                 return false;
                             }
-                            $response[$i] =& new xmlrpcresp(0, $code->scalarval(), $str->scalarval());
+                            $response[$i] = new xmlrpcresp(0, $code->scalarval(), $str->scalarval());
                             break;
                         default:
                             return false;
@@ -2224,7 +2224,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                     else
                     {
                         error_log('XML-RPC: xmlrpcmsg::parseResponse: HTTPS via proxy error, tunnel connection possibly failed');
-                        $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error']. ' (HTTPS via proxy error, tunnel connection possibly failed)');
+                        $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error']. ' (HTTPS via proxy error, tunnel connection possibly failed)');
                         return $r;
                     }
                 }
@@ -2245,7 +2245,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                 {
                     $errstr= substr($data, 0, strpos($data, "\n")-1);
                     error_log('XML-RPC: xmlrpcmsg::parseResponse: HTTP error, got response: ' .$errstr);
-                    $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error']. ' (' . $errstr . ')');
+                    $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error']. ' (' . $errstr . ')');
                     return $r;
                 }
 
@@ -2367,7 +2367,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                         if(!$data = decode_chunked($data))
                         {
                             error_log('XML-RPC: xmlrpcmsg::parseResponse: errors occurred when trying to rebuild the chunked data received from server');
-                            $r =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['dechunk_fail'], $GLOBALS['xmlrpcstr']['dechunk_fail']);
+                            $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['dechunk_fail'], $GLOBALS['xmlrpcstr']['dechunk_fail']);
                             return $r;
                         }
                     }
@@ -2397,14 +2397,14 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                                 else
                                 {
                                     error_log('XML-RPC: xmlrpcmsg::parseResponse: errors occurred when trying to decode the deflated data received from server');
-                                    $r =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['decompress_fail'], $GLOBALS['xmlrpcstr']['decompress_fail']);
+                                    $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['decompress_fail'], $GLOBALS['xmlrpcstr']['decompress_fail']);
                                     return $r;
                                 }
                             }
                             else
                             {
                                 error_log('XML-RPC: xmlrpcmsg::parseResponse: the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.');
-                                $r =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['cannot_decompress'], $GLOBALS['xmlrpcstr']['cannot_decompress']);
+                                $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['cannot_decompress'], $GLOBALS['xmlrpcstr']['cannot_decompress']);
                                 return $r;
                             }
                         }
@@ -2436,7 +2436,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
             if($data == '')
             {
                 error_log('XML-RPC: xmlrpcmsg::parseResponse: no response received from server.');
-                $r =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_data'], $GLOBALS['xmlrpcstr']['no_data']);
+                $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_data'], $GLOBALS['xmlrpcstr']['no_data']);
                 return $r;
             }
 
@@ -2496,7 +2496,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
             // if user wants back raw xml, give it to him
             if ($return_type == 'xml')
             {
-                $r =& new xmlrpcresp($data, 0, '', 'xml');
+                $r = new xmlrpcresp($data, 0, '', 'xml');
                 $r->hdrs = $GLOBALS['_xh']['headers'];
                 $r->_cookies = $GLOBALS['_xh']['cookies'];
                 $r->raw_data = $raw_data;
@@ -2557,7 +2557,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                         xml_get_current_line_number($parser), xml_get_current_column_number($parser));
                 }
                 error_log($errstr);
-                $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'], $GLOBALS['xmlrpcstr']['invalid_return'].' ('.$errstr.')');
+                $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'], $GLOBALS['xmlrpcstr']['invalid_return'].' ('.$errstr.')');
                 xml_parser_free($parser);
                 if($this->debug)
                 {
@@ -2577,7 +2577,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                     /// @todo echo something for user?
                 }
 
-                $r =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'],
+                $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'],
                 $GLOBALS['xmlrpcstr']['invalid_return'] . ' ' . $GLOBALS['_xh']['isf_reason']);
             }
             // third error check: parsing of the response has somehow gone boink.
@@ -2587,7 +2587,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                 // something odd has happened
                 // and it's time to generate a client side error
                 // indicating something odd went on
-                $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'],
+                $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['invalid_return'],
                     $GLOBALS['xmlrpcstr']['invalid_return']);
             }
             else
@@ -2627,11 +2627,11 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                         $errno = -1;
                     }
 
-                    $r =& new xmlrpcresp(0, $errno, $errstr);
+                    $r = new xmlrpcresp(0, $errno, $errstr);
                 }
                 else
                 {
-                    $r=&new xmlrpcresp($v, 0, '', $return_type);
+                    $r= new xmlrpcresp($v, 0, '', $return_type);
                 }
             }
 
@@ -2747,10 +2747,10 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                 case 2:
                     // we're adding a scalar value to an array here
                     //$ar=$this->me['array'];
-                    //$ar[]=&new xmlrpcval($val, $type);
+                    //$ar[]= new xmlrpcval($val, $type);
                     //$this->me['array']=$ar;
                     // Faster (?) avoid all the costly array-copy-by-val done here...
-                    $this->me['array'][]=&new xmlrpcval($val, $type);
+                    $this->me['array'][]= new xmlrpcval($val, $type);
                     return 1;
                 default:
                     // a scalar, so set the value and remember we're scalar
@@ -3296,20 +3296,20 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
         {
             case 'string':
                 if (in_array('auto_dates', $options) && preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $php_val))
-                    $xmlrpc_val =& new xmlrpcval($php_val, $GLOBALS['xmlrpcDateTime']);
+                    $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcDateTime']);
                 else
-                    $xmlrpc_val =& new xmlrpcval($php_val, $GLOBALS['xmlrpcString']);
+                    $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcString']);
                 break;
             case 'integer':
-                $xmlrpc_val =& new xmlrpcval($php_val, $GLOBALS['xmlrpcInt']);
+                $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcInt']);
                 break;
             case 'double':
-                $xmlrpc_val =& new xmlrpcval($php_val, $GLOBALS['xmlrpcDouble']);
+                $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcDouble']);
                 break;
                 // <G_Giunta_2001-02-29>
                 // Add support for encoding/decoding of booleans, since they are supported in PHP
             case 'boolean':
-                $xmlrpc_val =& new xmlrpcval($php_val, $GLOBALS['xmlrpcBoolean']);
+                $xmlrpc_val = new xmlrpcval($php_val, $GLOBALS['xmlrpcBoolean']);
                 break;
                 // </G_Giunta_2001-02-29>
             case 'array':
@@ -3332,11 +3332,11 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                 }
                 if($ko)
                 {
-                    $xmlrpc_val =& new xmlrpcval($arr, $GLOBALS['xmlrpcStruct']);
+                    $xmlrpc_val = new xmlrpcval($arr, $GLOBALS['xmlrpcStruct']);
                 }
                 else
                 {
-                    $xmlrpc_val =& new xmlrpcval($arr, $GLOBALS['xmlrpcArray']);
+                    $xmlrpc_val = new xmlrpcval($arr, $GLOBALS['xmlrpcArray']);
                 }
                 break;
             case 'object':
@@ -3351,7 +3351,7 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                     {
                         $arr[$k] = php_xmlrpc_encode($v, $options);
                     }
-                    $xmlrpc_val =& new xmlrpcval($arr, $GLOBALS['xmlrpcStruct']);
+                    $xmlrpc_val = new xmlrpcval($arr, $GLOBALS['xmlrpcStruct']);
                     if (in_array('encode_php_objs', $options))
                     {
                         // let's save original class name into xmlrpcval:
@@ -3363,32 +3363,32 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
             case 'NULL':
                 if (in_array('extension_api', $options))
                 {
-                    $xmlrpc_val =& new xmlrpcval('', $GLOBALS['xmlrpcString']);
+                    $xmlrpc_val = new xmlrpcval('', $GLOBALS['xmlrpcString']);
                 }
                 if (in_array('null_extension', $options))
                 {
-                    $xmlrpc_val =& new xmlrpcval('', $GLOBALS['xmlrpcNull']);
+                    $xmlrpc_val = new xmlrpcval('', $GLOBALS['xmlrpcNull']);
                 }
                 else
                 {
-                    $xmlrpc_val =& new xmlrpcval();
+                    $xmlrpc_val = new xmlrpcval();
                 }
                 break;
             case 'resource':
                 if (in_array('extension_api', $options))
                 {
-                    $xmlrpc_val =& new xmlrpcval((int)$php_val, $GLOBALS['xmlrpcInt']);
+                    $xmlrpc_val = new xmlrpcval((int)$php_val, $GLOBALS['xmlrpcInt']);
                 }
                 else
                 {
-                    $xmlrpc_val =& new xmlrpcval();
+                    $xmlrpc_val = new xmlrpcval();
                 }
             // catch "user function", "unknown type"
             default:
                 // giancarlo pinerolo <ping@alt.it>
                 // it has to return
                 // an empty object in case, not a boolean.
-                $xmlrpc_val =& new xmlrpcval();
+                $xmlrpc_val = new xmlrpcval();
                 break;
             }
             return $xmlrpc_val;
@@ -3443,15 +3443,15 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
                 {
                     $vc = $v->structmem('faultCode');
                     $vs = $v->structmem('faultString');
-                    $r =& new xmlrpcresp(0, $vc->scalarval(), $vs->scalarval());
+                    $r = new xmlrpcresp(0, $vc->scalarval(), $vs->scalarval());
                 }
                 else
                 {
-                    $r =& new xmlrpcresp($v);
+                    $r = new xmlrpcresp($v);
                 }
                 return $r;
             case 'methodcall':
-                $m =& new xmlrpcmsg($GLOBALS['_xh']['method']);
+                $m = new xmlrpcmsg($GLOBALS['_xh']['method']);
                 for($i=0; $i < count($GLOBALS['_xh']['params']); $i++)
                 {
                     $m->addParam($GLOBALS['_xh']['params'][$i]);