OSDN Git Service

FIX: PHP5/MySQL5における文法違反コードの修正
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / libs / xmlrpcs.inc.php
index 171e911..d7c0442 100755 (executable)
                $outAr=array();
                foreach($server->dmap as $key => $val)
                {
-                       $outAr[]=&new xmlrpcval($key, 'string');
+                       $outAr[]= new xmlrpcval($key, 'string');
                }
                if($server->allow_system_funcs)
                {
                        foreach($GLOBALS['_xmlrpcs_dmap'] as $key => $val)
                        {
-                               $outAr[]=&new xmlrpcval($key, 'string');
+                               $outAr[]= new xmlrpcval($key, 'string');
                        }
                }
                return new xmlrpcresp(new xmlrpcval($outAr, 'array'));
                                        $cursig=array();
                                        foreach($inSig as $sig)
                                        {
-                                               $cursig[]=&new xmlrpcval($sig, 'string');
+                                               $cursig[]= new xmlrpcval($sig, 'string');
                                        }
-                                       $sigs[]=&new xmlrpcval($cursig, 'array');
+                                       $sigs[]= new xmlrpcval($cursig, 'array');
                                }
-                               $r=&new xmlrpcresp(new xmlrpcval($sigs, 'array'));
+                               $r= new xmlrpcresp(new xmlrpcval($sigs, 'array'));
                        }
                        else
                        {
                                // NB: according to the official docs, we should be returning a
                                // "none-array" here, which means not-an-array
-                               $r=&new xmlrpcresp(new xmlrpcval('undef', 'string'));
+                               $r= new xmlrpcresp(new xmlrpcval('undef', 'string'));
                        }
                }
                else
                {
-                       $r=&new xmlrpcresp(0,$GLOBALS['xmlrpcerr']['introspect_unknown'], $GLOBALS['xmlrpcstr']['introspect_unknown']);
+                       $r= new xmlrpcresp(0,$GLOBALS['xmlrpcerr']['introspect_unknown'], $GLOBALS['xmlrpcstr']['introspect_unknown']);
                }
                return $r;
        }
                {
                        if(isset($dmap[$methName]['docstring']))
                        {
-                               $r=&new xmlrpcresp(new xmlrpcval($dmap[$methName]['docstring']), 'string');
+                               $r= new xmlrpcresp(new xmlrpcval($dmap[$methName]['docstring']), 'string');
                        }
                        else
                        {
-                               $r=&new xmlrpcresp(new xmlrpcval('', 'string'));
+                               $r= new xmlrpcresp(new xmlrpcval('', 'string'));
                        }
                }
                else
                {
-                       $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['introspect_unknown'], $GLOBALS['xmlrpcstr']['introspect_unknown']);
+                       $r= new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['introspect_unknown'], $GLOBALS['xmlrpcstr']['introspect_unknown']);
                }
                return $r;
        }
                        $str = $err->faultString();
                }
                $struct = array();
-               $struct['faultCode'] =& new xmlrpcval($code, 'int');
-               $struct['faultString'] =& new xmlrpcval($str, 'string');
+               $struct['faultCode'] = new xmlrpcval($code, 'int');
+               $struct['faultString'] = new xmlrpcval($str, 'string');
                return new xmlrpcval($struct, 'struct');
        }
 
                }
                $numParams = $params->arraysize();
 
-               $msg =& new xmlrpcmsg($methName->scalarval());
+               $msg = new xmlrpcmsg($methName->scalarval());
                for($i = 0; $i < $numParams; $i++)
                {
                        if(!$msg->addParam($params->arraymem($i)))
                                                }
                                                else
                                                {
-                                                       $r =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['server_decompress_fail'], $GLOBALS['xmlrpcstr']['server_decompress_fail']);
+                                                       $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['server_decompress_fail'], $GLOBALS['xmlrpcstr']['server_decompress_fail']);
                                                        return $r;
                                                }
                                        }
                                        else
                                        {
                                                //error_log('The server sent deflated data. Your php install must have the Zlib extension compiled in to support this.');
-                                               $r =& new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['server_cannot_decompress'], $GLOBALS['xmlrpcstr']['server_cannot_decompress']);
+                                               $r = new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['server_cannot_decompress'], $GLOBALS['xmlrpcstr']['server_cannot_decompress']);
                                                return $r;
                                        }
                                }
                        if(!xml_parse($parser, $data, 1))
                        {
                                // return XML error as a faultCode
-                               $r=&new xmlrpcresp(0,
+                               $r= new xmlrpcresp(0,
                                $GLOBALS['xmlrpcerrxml']+xml_get_error_code($parser),
                                sprintf('XML error: %s at line %d, column %d',
                                        xml_error_string(xml_get_error_code($parser)),
                        elseif ($GLOBALS['_xh']['isf'])
                        {
                                xml_parser_free($parser);
-                               $r=&new xmlrpcresp(0,
+                               $r= new xmlrpcresp(0,
                                        $GLOBALS['xmlrpcerr']['invalid_request'],
                                        $GLOBALS['xmlrpcstr']['invalid_request'] . ' ' . $GLOBALS['_xh']['isf_reason']);
                        }
                                else
                                {
                                        // build an xmlrpcmsg object with data parsed from xml
-                                       $m=&new xmlrpcmsg($GLOBALS['_xh']['method']);
+                                       $m= new xmlrpcmsg($GLOBALS['_xh']['method']);
                                        // now add parameters in
                                        for($i=0; $i<count($GLOBALS['_xh']['params']); $i++)
                                        {
                                        error_log("XML-RPC: xmlrpc_server::execute: function $func registered as method handler does not return an xmlrpcresp object");
                                        if (is_a($r, 'xmlrpcval'))
                                        {
-                                               $r =& new xmlrpcresp($r);
+                                               $r = new xmlrpcresp($r);
                                        }
                                        else
                                        {
-                                               $r =& new xmlrpcresp(
+                                               $r = new xmlrpcresp(
                                                        0,
                                                        $GLOBALS['xmlrpcerr']['server_error'],
                                                        $GLOBALS['xmlrpcstr']['server_error'] . ": function does not return xmlrpcresp object"
                                        // 3rd API convention for method-handling functions: EPI-style
                                        if ($this->functions_parameters_type == 'epivals')
                                        {
-                                               $r = call_user_func_array($func, array($methName, $params, $this->user_data));
+                                               $data = array($methName, $params, $this->user_data);
+                                               $r = call_user_func_array($func, $data);
                                                // mimic EPI behaviour: if we get an array that looks like an error, make it
                                                // an eror response
                                                if (is_array($r) && array_key_exists('faultCode', $r) && array_key_exists('faultString', $r))
                                                {
-                                                       $r =& new xmlrpcresp(0, (integer)$r['faultCode'], (string)$r['faultString']);
+                                                       $r = new xmlrpcresp(0, (integer)$r['faultCode'], (string)$r['faultString']);
                                                }
                                                else
                                                {
                                                        // functions using EPI api should NOT return resp objects,
                                                        // so make sure we encode the return type correctly
-                                                       $r =& new xmlrpcresp(php_xmlrpc_encode($r, array('extension_api')));
+                                                       $r = new xmlrpcresp(php_xmlrpc_encode($r, array('extension_api')));
                                                }
                                        }
                                        else
                                {
                                        // what should we assume here about automatic encoding of datetimes
                                        // and php classes instances???
-                                       $r =& new xmlrpcresp(php_xmlrpc_encode($r, array('auto_dates')));
+                                       $r = new xmlrpcresp(php_xmlrpc_encode($r, array('auto_dates')));
                                }
                        }
                        if($this->debug > 2)
                */
                function echoInput()
                {
-                       $r=&new xmlrpcresp(new xmlrpcval( "'Aha said I: '" . $GLOBALS['HTTP_RAW_POST_DATA'], 'string'));
+                       $r= new xmlrpcresp(new xmlrpcval( "'Aha said I: '" . $GLOBALS['HTTP_RAW_POST_DATA'], 'string'));
                        print $r->serialize();
                }
        }