From f4a4bd8fac188ebc9cda822ffc811c218fd92b45 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 20 Oct 2011 12:18:42 -0500 Subject: adding new license file (OSL 3.0) and updating readme to ReST added notice of license to all source files. OSL to all except the few files we ship inside of the application folder, those are AFL. Updated license in user guide. incrementing next dev version to 3.0 due to licensing change --- system/libraries/Xmlrpcs.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 9cd332147..587b75040 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -31,7 +43,7 @@ if ( ! class_exists('CI_Xmlrpc')) * @package CodeIgniter * @subpackage Libraries * @category XML-RPC - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class CI_Xmlrpcs extends CI_Xmlrpc -- cgit v1.2.3-24-g4f1b From 56e3214d8e05d3b74bf728c675ce0691399b3867 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 25 Dec 2011 18:36:31 +0200 Subject: Improve the Xmlrpcs library --- system/libraries/Xmlrpcs.php | 144 ++++++++++++++++++++----------------------- 1 file changed, 68 insertions(+), 76 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 587b75040..893e51873 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -1,13 +1,13 @@ -methods = array( 'system.listMethods' => array( - 'function' => 'this.listMethods', - 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString), array($this->xmlrpcArray)), - 'docstring' => 'Returns an array of available methods on this server'), - 'system.methodHelp' => array( - 'function' => 'this.methodHelp', - 'signature' => array(array($this->xmlrpcString, $this->xmlrpcString)), - 'docstring' => 'Returns a documentation string for the specified method'), + 'function' => 'this.listMethods', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString), array($this->xmlrpcArray)), + 'docstring' => 'Returns an array of available methods on this server'), + 'system.methodHelp' => array( + 'function' => 'this.methodHelp', + 'signature' => array(array($this->xmlrpcString, $this->xmlrpcString)), + 'docstring' => 'Returns a documentation string for the specified method'), 'system.methodSignature' => array( - 'function' => 'this.methodSignature', - 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString)), - 'docstring' => 'Returns an array describing the return type and required parameters of a method'), - 'system.multicall' => array( - 'function' => 'this.multicall', - 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcArray)), - 'docstring' => 'Combine multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details') - ); + 'function' => 'this.methodSignature', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString)), + 'docstring' => 'Returns an array describing the return type and required parameters of a method'), + 'system.multicall' => array( + 'function' => 'this.multicall', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcArray)), + 'docstring' => 'Combine multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details') + ); } // -------------------------------------------------------------------- @@ -141,12 +140,10 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @access public * @return void */ - function serve() + public function serve() { $r = $this->parseRequest(); - $payload = 'xmlrpc_defencoding.'"?'.'>'."\n"; - $payload .= $this->debug_msg; - $payload .= $r->prepare_response(); + $payload = 'xmlrpc_defencoding.'"?'.'>'."\n".$this->debug_msg.$r->prepare_response(); header("Content-Type: text/xml"); header("Content-Length: ".strlen($payload)); @@ -165,7 +162,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param string docstring * @return void */ - function add_to_map($methodname, $function, $sig, $doc) + public function add_to_map($methodname, $function, $sig, $doc) { $this->methods[$methodname] = array( 'function' => $function, @@ -183,7 +180,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param string data * @return object xmlrpc response */ - function parseRequest($data='') + public function parseRequest($data = '') { global $HTTP_RAW_POST_DATA; @@ -203,13 +200,14 @@ class CI_Xmlrpcs extends CI_Xmlrpc $parser = xml_parser_create($this->xmlrpc_defencoding); $parser_object = new XML_RPC_Message("filler"); - $parser_object->xh[$parser] = array(); - $parser_object->xh[$parser]['isf'] = 0; - $parser_object->xh[$parser]['isf_reason'] = ''; - $parser_object->xh[$parser]['params'] = array(); - $parser_object->xh[$parser]['stack'] = array(); - $parser_object->xh[$parser]['valuestack'] = array(); - $parser_object->xh[$parser]['method'] = ''; + $parser_object->xh[$parser] = array( + 'isf' => 0, + 'isf_reason' => '', + 'params' => array(), + 'stack' => array(), + 'valuestack' => array(), + 'method' => '' + ); xml_set_object($parser, $parser_object); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); @@ -243,7 +241,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); $plist=''; - for ($i=0; $i < count($parser_object->xh[$parser]['params']); $i++) + for ($i = 0, $c = count($parser_object->xh[$parser]['params']); $i < $c; $i++) { if ($this->debug === TRUE) { @@ -255,9 +253,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc if ($this->debug === TRUE) { - echo "
";
-				echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
-				echo "
"; + echo "
---PLIST---\n".$plist."\n---PLIST END---\n\n
"; } $r = $this->_execute($m); @@ -284,12 +280,12 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param object * @return mixed */ - function _execute($m) + protected function _execute($m) { $methName = $m->method_name; // Check to see if it is a system call - $system_call = (strncmp($methName, 'system', 5) == 0) ? TRUE : FALSE; + $system_call = (strncmp($methName, 'system', 5) === 0); if ($this->xss_clean == FALSE) { @@ -310,22 +306,20 @@ class CI_Xmlrpcs extends CI_Xmlrpc //------------------------------------- $method_parts = explode(".", $this->methods[$methName]['function']); - $objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? TRUE : FALSE; + $objectCall = (isset($method_parts[1]) && $method_parts[1] != ''); if ($system_call === TRUE) { - if ( ! is_callable(array($this,$method_parts['1']))) + if ( ! is_callable(array($this,$method_parts[1]))) { return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); } } else { - if ($objectCall && ! is_callable(array($method_parts['0'],$method_parts['1']))) - { - return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); - } - elseif ( ! $objectCall && ! is_callable($this->methods[$methName]['function'])) + if (($objectCall AND ! is_callable(array($method_parts[0], $method_parts[1]))) + OR ( ! $objectCall AND ! is_callable($this->methods[$methName]['function'])) + ) { return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); } @@ -338,13 +332,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc if (isset($this->methods[$methName]['signature'])) { $sig = $this->methods[$methName]['signature']; - for ($i=0; $iparams)+1) + if (count($current_sig) === count($m->params)+1) { - for ($n=0; $n < count($m->params); $n++) + for ($n = 0, $mc = count($m->params); $n < $mc; $n++) { $p = $m->params[$n]; $pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf(); @@ -370,7 +364,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc if ($objectCall === TRUE) { - if ($method_parts[0] == "this" && $system_call == TRUE) + if ($method_parts[0] === 'this' && $system_call === TRUE) { return call_user_func(array($this, $method_parts[1]), $m); } @@ -379,11 +373,11 @@ class CI_Xmlrpcs extends CI_Xmlrpc if ($this->object === FALSE) { $CI =& get_instance(); - return $CI->$method_parts['1']($m); + return $CI->$method_parts[1]($m); } else { - return $this->object->$method_parts['1']($m); + return $this->object->$method_parts[1]($m); //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); } } @@ -393,7 +387,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc return call_user_func($this->methods[$methName]['function'], $m); } } - + // -------------------------------------------------------------------- /** @@ -403,7 +397,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param mixed * @return object */ - function listMethods($m) + public function listMethods($m) { $v = new XML_RPC_Values(); $output = array(); @@ -421,7 +415,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $v->addArray($output); return new XML_RPC_Response($v); } - + // -------------------------------------------------------------------- /** @@ -431,7 +425,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param mixed * @return object */ - function methodSignature($m) + public function methodSignature($m) { $parameters = $m->output_parameters(); $method_name = $parameters[0]; @@ -443,15 +437,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc $sigs = array(); $signature = $this->methods[$method_name]['signature']; - for ($i=0; $i < count($signature); $i++) + for ($i = 0, $c = count($signature); $i < $c; $i++) { $cursig = array(); $inSig = $signature[$i]; - for ($j=0; $joutput_parameters(); $method_name = $parameters[0]; @@ -492,7 +486,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); } } - + // -------------------------------------------------------------------- /** @@ -502,7 +496,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param mixed * @return object */ - function multicall($m) + public function multicall($m) { // Disabled return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); @@ -519,7 +513,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $m = new XML_RPC_Message($value[0]); $plist=''; - for ($i=0; $i < count($value[1]); $i++) + for ($i = 0, $c = count($value[1]); $i < $c; $i++) { $m->addParam(new XML_RPC_Values($value[1][$i], 'string')); } @@ -546,7 +540,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param mixed * @return object */ - function multicall_error($err) + public function multicall_error($err) { $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); @@ -566,7 +560,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @param mixed * @return object */ - function do_multicall($call) + public function do_multicall($call) { if ($call->kindOf() != 'struct') { @@ -597,11 +591,10 @@ class CI_Xmlrpcs extends CI_Xmlrpc return $this->multicall_error('notarray'); } - list($a,$b)=each($params->me); - $numParams = count($b); + list($a,$b) = each($params->me); $msg = new XML_RPC_Message($scalar_value); - for ($i = 0; $i < $numParams; $i++) + for ($i = 0, $numParams = count($b); $i < $numParams; $i++) { $msg->params[] = $params->me['array'][$i]; } @@ -619,6 +612,5 @@ class CI_Xmlrpcs extends CI_Xmlrpc } // END XML_RPC_Server class - /* End of file Xmlrpcs.php */ -/* Location: ./system/libraries/Xmlrpcs.php */ \ No newline at end of file +/* Location: ./system/libraries/Xmlrpcs.php */ -- cgit v1.2.3-24-g4f1b From 0defe5d33ee2633f377a109519ca818becc60f64 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 1 Jan 2012 18:46:41 -0600 Subject: Updating copyright date to 2012 --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 893e51873..355d43f29 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 355d43f29..fc41444bc 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From 5227837eca102b5aa2c14daa4201ffcb0a79f246 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 26 Mar 2012 16:02:30 +0300 Subject: Remove access description lines and cleanup the Xmlrpcs library --- system/libraries/Xmlrpcs.php | 64 ++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 44 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index fc41444bc..6d270c2ea 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -54,10 +54,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc public $controller_obj; public $object = FALSE; - /** - * Constructor - */ - public function __construct($config=array()) + public function __construct($config = array()) { parent::__construct(); $this->set_system_methods(); @@ -67,7 +64,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $this->methods = array_merge($this->methods, $config['functions']); } - log_message('debug', "XML-RPC Server Class Initialized"); + log_message('debug', 'XML-RPC Server Class Initialized'); } // -------------------------------------------------------------------- @@ -75,7 +72,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Initialize Prefs and Serve * - * @access public * @param mixed * @return void */ @@ -107,7 +103,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Setting of System Methods * - * @access public * @return void */ public function set_system_methods() @@ -137,7 +132,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Main Server Function * - * @access public * @return void */ public function serve() @@ -145,8 +139,8 @@ class CI_Xmlrpcs extends CI_Xmlrpc $r = $this->parseRequest(); $payload = 'xmlrpc_defencoding.'"?'.'>'."\n".$this->debug_msg.$r->prepare_response(); - header("Content-Type: text/xml"); - header("Content-Length: ".strlen($payload)); + header('Content-Type: text/xml'); + header('Content-Length: '.strlen($payload)); exit($payload); } @@ -155,7 +149,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Add Method to Class * - * @access public * @param string method name * @param string function * @param string signature @@ -176,7 +169,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Parse Server Request * - * @access public * @param string data * @return object xmlrpc response */ @@ -198,7 +190,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc //------------------------------------- $parser = xml_parser_create($this->xmlrpc_defencoding); - $parser_object = new XML_RPC_Message("filler"); + $parser_object = new XML_RPC_Message('filler'); $parser_object->xh[$parser] = array( 'isf' => 0, @@ -215,7 +207,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc xml_set_character_data_handler($parser, 'character_data'); //xml_set_default_handler($parser, 'default_handler'); - //------------------------------------- // PARSE + PROCESS XML DATA //------------------------------------- @@ -245,7 +236,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { if ($this->debug === TRUE) { - $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; + $plist .= $i.' - '.print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE).";\n"; } $m->addParam($parser_object->xh[$parser]['params'][$i]); @@ -276,7 +267,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Executes the Method * - * @access protected * @param object * @return mixed */ @@ -305,7 +295,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // Check for Method (and Object) //------------------------------------- - $method_parts = explode(".", $this->methods[$methName]['function']); + $method_parts = explode('.', $this->methods[$methName]['function']); $objectCall = (isset($method_parts[1]) && $method_parts[1] != ''); if ($system_call === TRUE) @@ -315,14 +305,11 @@ class CI_Xmlrpcs extends CI_Xmlrpc return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); } } - else + elseif (($objectCall && ! is_callable(array($method_parts[0], $method_parts[1]))) + OR ( ! $objectCall && ! is_callable($this->methods[$methName]['function'])) + ) { - if (($objectCall AND ! is_callable(array($method_parts[0], $method_parts[1]))) - OR ( ! $objectCall AND ! is_callable($this->methods[$methName]['function'])) - ) - { - return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); - } + return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); } //------------------------------------- @@ -351,7 +338,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc return new XML_RPC_Response(0, $this->xmlrpcerr['incorrect_params'], $this->xmlrpcstr['incorrect_params'] . - ": Wanted {$wanted}, got {$pt} at param {$pno})"); + ': Wanted '.$wanted.', got '.$pt.' at param '.$pno.')'); } } } @@ -393,7 +380,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Server Function: List Methods * - * @access public * @param mixed * @return object */ @@ -409,7 +395,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc foreach ($this->system_methods as $key => $value) { - $output[]= new XML_RPC_Values($key, 'string'); + $output[] = new XML_RPC_Values($key, 'string'); } $v->addArray($output); @@ -421,7 +407,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Server Function: Return Signature for Method * - * @access public * @param mixed * @return object */ @@ -447,18 +432,14 @@ class CI_Xmlrpcs extends CI_Xmlrpc } $sigs[] = new XML_RPC_Values($cursig, 'array'); } - $r = new XML_RPC_Response(new XML_RPC_Values($sigs, 'array')); - } - else - { - $r = new XML_RPC_Response(new XML_RPC_Values('undef', 'string')); + + return new XML_RPC_Response(new XML_RPC_Values($sigs, 'array')); } + + return new XML_RPC_Response(new XML_RPC_Values('undef', 'string')); } - else - { - $r = new XML_RPC_Response(0,$this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); - } - return $r; + + return new XML_RPC_Response(0,$this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); } // -------------------------------------------------------------------- @@ -466,7 +447,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Server Function: Doc String for Method * - * @access public * @param mixed * @return object */ @@ -492,7 +472,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Server Function: Multi-call * - * @access public * @param mixed * @return object */ @@ -536,7 +515,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Multi-call Function: Error Handling * - * @access public * @param mixed * @return object */ @@ -556,7 +534,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Multi-call Function: Processes method * - * @access public * @param mixed * @return object */ @@ -610,7 +587,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc } } -// END XML_RPC_Server class /* End of file Xmlrpcs.php */ -/* Location: ./system/libraries/Xmlrpcs.php */ +/* Location: ./system/libraries/Xmlrpcs.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 0688ac9ad88a03f1c56cfcd9e3c475b83301344d Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 20 Apr 2012 10:25:04 -0400 Subject: Start comment cleanup of libraries --- system/libraries/Xmlrpcs.php | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 6d270c2ea..f0c5b48e7 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -48,12 +48,39 @@ if ( ! class_exists('CI_Xmlrpc')) */ class CI_Xmlrpcs extends CI_Xmlrpc { - public $methods = array(); //array of methods mapped to function names and signatures - public $debug_msg = ''; // Debug Message - public $system_methods = array(); // XML RPC Server methods - public $controller_obj; - public $object = FALSE; + /** + * array of methods mapped to function names and signatures + * + * @var array + */ + public $methods = array(); + + /** + * Debug Message + * + * @var string + */ + public $debug_msg = ''; + + /** + * XML RPC Server methods + * + * @var array + */ + public $system_methods = array(); + + /** + * Configuration object + * + * @var object + */ + public $object = FALSE; + /** + * Initialize XMLRPC class + * + * @param array $config + */ public function __construct($config = array()) { parent::__construct(); -- cgit v1.2.3-24-g4f1b From 5645479c622eb36cf9869797896dc0921568c4a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 May 2012 14:32:19 +0300 Subject: Clean up the libraries --- system/libraries/Xmlrpcs.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index f0c5b48e7..1853906ea 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -54,21 +54,21 @@ class CI_Xmlrpcs extends CI_Xmlrpc * @var array */ public $methods = array(); - + /** * Debug Message * * @var string */ public $debug_msg = ''; - + /** * XML RPC Server methods * * @var array */ public $system_methods = array(); - + /** * Configuration object * @@ -79,7 +79,8 @@ class CI_Xmlrpcs extends CI_Xmlrpc /** * Initialize XMLRPC class * - * @param array $config + * @param array $config + * @return void */ public function __construct($config = array()) { -- cgit v1.2.3-24-g4f1b From d261b1e89c3d4d5191036d5a5660ef6764e593a0 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:12:16 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/libraries --- system/libraries/Xmlrpcs.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 1853906ea..be930b0f9 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -208,7 +208,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // Get Data //------------------------------------- - if ($data == '') + if ($data === '') { $data = $HTTP_RAW_POST_DATA; } @@ -305,7 +305,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // Check to see if it is a system call $system_call = (strncmp($methName, 'system', 5) === 0); - if ($this->xss_clean == FALSE) + if ($this->xss_clean === FALSE) { $m->xss_clean = FALSE; } @@ -324,7 +324,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc //------------------------------------- $method_parts = explode('.', $this->methods[$methName]['function']); - $objectCall = (isset($method_parts[1]) && $method_parts[1] != ''); + $objectCall = (isset($method_parts[1]) && $method_parts[1] !== ''); if ($system_call === TRUE) { @@ -356,9 +356,9 @@ class CI_Xmlrpcs extends CI_Xmlrpc for ($n = 0, $mc = count($m->params); $n < $mc; $n++) { $p = $m->params[$n]; - $pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf(); + $pt = ($p->kindOf() === 'scalar') ? $p->scalarval() : $p->kindOf(); - if ($pt != $current_sig[$n+1]) + if ($pt !== $current_sig[$n+1]) { $pno = $n+1; $wanted = $current_sig[$n+1]; @@ -527,7 +527,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $attempt = $this->_execute($m); - if ($attempt->faultCode() != 0) + if ($attempt->faultCode() !== 0) { return $attempt; } @@ -567,7 +567,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc */ public function do_multicall($call) { - if ($call->kindOf() != 'struct') + if ($call->kindOf() !== 'struct') { return $this->multicall_error('notstruct'); } @@ -577,13 +577,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc } list($scalar_type,$scalar_value)=each($methName->me); - $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; + $scalar_type = $scalar_type === $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; - if ($methName->kindOf() != 'scalar' OR $scalar_type != 'string') + if ($methName->kindOf() !== 'scalar' OR $scalar_type !== 'string') { return $this->multicall_error('notstring'); } - elseif ($scalar_value == 'system.multicall') + elseif ($scalar_value === 'system.multicall') { return $this->multicall_error('recursion'); } @@ -591,7 +591,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { return $this->multicall_error('noparams'); } - elseif ($params->kindOf() != 'array') + elseif ($params->kindOf() !== 'array') { return $this->multicall_error('notarray'); } @@ -606,7 +606,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $result = $this->_execute($msg); - if ($result->faultCode() != 0) + if ($result->faultCode() !== 0) { return $this->multicall_error($result); } -- cgit v1.2.3-24-g4f1b From 3dad2e714189b992248261c78d780b322b3c73da Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 14 Jun 2012 15:10:56 +0300 Subject: Replace strncmp() usage with strpos() --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index be930b0f9..e81f2ca9a 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -303,7 +303,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $methName = $m->method_name; // Check to see if it is a system call - $system_call = (strncmp($methName, 'system', 5) === 0); + $system_call = (strpos($methName, 'system') === 0); if ($this->xss_clean === FALSE) { -- cgit v1.2.3-24-g4f1b From afee226aa4487b3645fb916f99b4cf7f012af536 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sun, 15 Jul 2012 18:59:01 +0100 Subject: Changed TRUE and FALSE values to be uppercase --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index e81f2ca9a..5d01d374d 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -230,7 +230,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc ); xml_set_object($parser, $parser_object); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE); xml_set_element_handler($parser, 'open_tag', 'closing_tag'); xml_set_character_data_handler($parser, 'character_data'); //xml_set_default_handler($parser, 'default_handler'); -- cgit v1.2.3-24-g4f1b From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/libraries/Xmlrpcs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 5d01d374d..3c3337bf2 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -1,4 +1,4 @@ - Date: Fri, 23 Nov 2012 23:48:35 +0200 Subject: Minor changes to Xmlrpcs.php --- system/libraries/Xmlrpcs.php | 57 +++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 30 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 3c3337bf2..d6c3416c9 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -47,10 +47,10 @@ if ( ! class_exists('CI_Xmlrpc')) * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ -class CI_Xmlrpcs extends CI_Xmlrpc -{ +class CI_Xmlrpcs extends CI_Xmlrpc { + /** - * array of methods mapped to function names and signatures + * Array of methods mapped to function names and signatures * * @var array */ @@ -187,9 +187,9 @@ class CI_Xmlrpcs extends CI_Xmlrpc public function add_to_map($methodname, $function, $sig, $doc) { $this->methods[$methodname] = array( - 'function' => $function, - 'signature' => $sig, - 'docstring' => $doc + 'function' => $function, + 'signature' => $sig, + 'docstring' => $doc ); } @@ -237,15 +237,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc //xml_set_default_handler($parser, 'default_handler'); //------------------------------------- - // PARSE + PROCESS XML DATA + // PARSE + PROCESS XML DATA //------------------------------------- if ( ! xml_parse($parser, $data, 1)) { - // return XML error as a faultCode + // Return XML error as a faultCode $r = new XML_RPC_Response(0, - $this->xmlrpcerrxml + xml_get_error_code($parser), - sprintf('XML error: %s at line %d', + $this->xmlrpcerrxml + xml_get_error_code($parser), + sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser))); xml_parser_free($parser); @@ -259,7 +259,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc xml_parser_free($parser); $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); - $plist=''; + $plist = ''; for ($i = 0, $c = count($parser_object->xh[$parser]['params']); $i < $c; $i++) { @@ -280,7 +280,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // SET DEBUGGING MESSAGE + // SET DEBUGGING MESSAGE //------------------------------------- if ($this->debug === TRUE) @@ -312,7 +312,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Valid Method + // Valid Method //------------------------------------- if ( ! isset($this->methods[$methName]['function'])) @@ -321,7 +321,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Check for Method (and Object) + // Check for Method (and Object) //------------------------------------- $method_parts = explode('.', $this->methods[$methName]['function']); @@ -342,7 +342,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Checking Methods Signature + // Checking Methods Signature //------------------------------------- if (isset($this->methods[$methName]['signature'])) @@ -375,7 +375,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Calls the Function + // Calls the Function //------------------------------------- if ($objectCall === TRUE) @@ -394,7 +394,6 @@ class CI_Xmlrpcs extends CI_Xmlrpc else { return $this->object->$method_parts[1]($m); - //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); } } } @@ -407,7 +406,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Server Function: List Methods + * Server Function: List Methods * * @param mixed * @return object @@ -434,7 +433,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Server Function: Return Signature for Method + * Server Function: Return Signature for Method * * @param mixed * @return object @@ -468,13 +467,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc return new XML_RPC_Response(new XML_RPC_Values('undef', 'string')); } - return new XML_RPC_Response(0,$this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); + return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); } // -------------------------------------------------------------------- /** - * Server Function: Doc String for Method + * Server Function: Doc String for Method * * @param mixed * @return object @@ -499,7 +498,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Server Function: Multi-call + * Server Function: Multi-call * * @param mixed * @return object @@ -516,10 +515,8 @@ class CI_Xmlrpcs extends CI_Xmlrpc foreach ($calls as $value) { - //$attempt = $this->_execute(new XML_RPC_Message($value[0], $value[1])); - $m = new XML_RPC_Message($value[0]); - $plist=''; + $plist = ''; for ($i = 0, $c = count($value[1]); $i < $c; $i++) { @@ -542,14 +539,14 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Multi-call Function: Error Handling + * Multi-call Function: Error Handling * * @param mixed * @return object */ public function multicall_error($err) { - $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); + $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); $struct['faultCode'] = new XML_RPC_Values($code, 'int'); @@ -561,7 +558,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Multi-call Function: Processes method + * Multi-call Function: Processes method * * @param mixed * @return object @@ -577,7 +574,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc return $this->multicall_error('nomethod'); } - list($scalar_type,$scalar_value)=each($methName->me); + list($scalar_type, $scalar_value) = each($methName->me); $scalar_type = $scalar_type === $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; if ($methName->kindOf() !== 'scalar' OR $scalar_type !== 'string') @@ -597,7 +594,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc return $this->multicall_error('notarray'); } - list($a,$b) = each($params->me); + list($a, $b) = each($params->me); $msg = new XML_RPC_Message($scalar_value); for ($i = 0, $numParams = count($b); $i < $numParams; $i++) -- cgit v1.2.3-24-g4f1b From 80500afbd188600212ca913a7bac073009feac73 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 1 Jan 2013 08:16:53 +0200 Subject: [ci skip] Happy new year --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index d6c3416c9..d4524d230 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 49e68de96b420a444c826995746a5f09470e76d9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 21 Feb 2013 16:30:55 +0200 Subject: Disable autoloader call from class_exists() occurences to improve performance Note: The Driver libary tests seem to depend on that, so one occurence in CI_Loader is left until we resolve that. --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index d4524d230..d263d789d 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -31,7 +31,7 @@ if ( ! function_exists('xml_parser_create')) show_error('Your PHP installation does not support XML'); } -if ( ! class_exists('CI_Xmlrpc')) +if ( ! class_exists('CI_Xmlrpc', FALSE)) { show_error('You must load the Xmlrpc class before loading the Xmlrpcs class in order to create a server.'); } -- cgit v1.2.3-24-g4f1b From 119d8a7547e155edaaa53682b9247cd7e80d8c9d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 8 Jan 2014 15:27:53 +0200 Subject: Optimize get_instance() calls/assignments --- system/libraries/Xmlrpcs.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index d263d789d..50ff423f2 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -384,17 +384,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc { { return call_user_func(array($this, $method_parts[1]), $m); } + elseif ($this->object === FALSE) + { + return get_instance()->$method_parts[1]($m); + } else { - if ($this->object === FALSE) - { - $CI =& get_instance(); - return $CI->$method_parts[1]($m); - } - else - { - return $this->object->$method_parts[1]($m); - } + return $this->object->$method_parts[1]($m); } } else -- cgit v1.2.3-24-g4f1b From 871754af60251993d640981e107d2def5f2db396 Mon Sep 17 00:00:00 2001 From: darwinel Date: Tue, 11 Feb 2014 17:34:57 +0100 Subject: 2013 > 2014 Update copyright notices from 2013 to 2014. And update one calendar example in user_guide from year 2013/2014 to 2014/2015. --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 50ff423f2..e8e06d756 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 20e802eea2fc455622a0f4f721cb82acb046f5b8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 24 Feb 2014 12:16:48 +0200 Subject: Really don't use globals --- system/libraries/Xmlrpcs.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index e8e06d756..bed18ebae 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -203,15 +203,17 @@ class CI_Xmlrpcs extends CI_Xmlrpc { */ public function parseRequest($data = '') { - global $HTTP_RAW_POST_DATA; - //------------------------------------- // Get Data //------------------------------------- if ($data === '') { - $data = $HTTP_RAW_POST_DATA; + $CI =& get_instance(); + if ($CI->input->method() === 'post') + { + $data = http_build_query($CI->input->input_stream(NULL, FALSE)); + } } //------------------------------------- @@ -222,13 +224,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc { $parser_object = new XML_RPC_Message('filler'); $parser_object->xh[$parser] = array( - 'isf' => 0, - 'isf_reason' => '', - 'params' => array(), - 'stack' => array(), - 'valuestack' => array(), - 'method' => '' - ); + 'isf' => 0, + 'isf_reason' => '', + 'params' => array(), + 'stack' => array(), + 'valuestack' => array(), + 'method' => '' + ); xml_set_object($parser, $parser_object); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE); -- cgit v1.2.3-24-g4f1b From bdb96ca1b1dbfc1791172fd169d7751cbc4d7d55 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Oct 2014 00:13:31 +0200 Subject: [ci skip] Switch to MIT license; close #3293 --- system/libraries/Xmlrpcs.php | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index bed18ebae..4e1966cd1 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -4,24 +4,35 @@ * * An open source application development framework for PHP 5.2.4 or newer * - * NOTICE OF LICENSE + * This content is released under the MIT License (MIT) * - * Licensed under the Open Software License version 3.0 + * Copyright (c) 2014, British Columbia Institute of Technology * - * This source file is subject to the Open Software License (OSL 3.0) that is - * bundled with this package in the files license.txt / license.rst. It is - * also available through the world wide web at this URL: - * http://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to obtain it - * through the world wide web, please send an email to - * licensing@ellislab.com so we can send you a copy immediately. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * @package CodeIgniter - * @author EllisLab Dev Team + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @package CodeIgniter + * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * @link http://codeigniter.com - * @since Version 1.0 + * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @license http://opensource.org/licenses/MIT MIT License + * @link http://codeigniter.com + * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); -- cgit v1.2.3-24-g4f1b From fe9309d22c1b088f5363954d6dac013c8c955894 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 Jan 2015 17:48:58 +0200 Subject: Bulk (mostly documentation) update - Remove PHP version from license notices - Bump year number in copyright notices - Recommend PHP 5.4 or newer to be used - Tell Travis-CI to test on PHP 5.3.0 instead of the latest 5.3 version Related: #3450 --- system/libraries/Xmlrpcs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 4e1966cd1..f786b2323 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.2.4 or newer + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014, British Columbia Institute of Technology + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 90726b8c769ea75aec34814ddfa91655d488e6c3 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Jan 2015 12:39:22 +0200 Subject: [ci skip] Change some log messages' level 'Class Loaded' type of messages flood log files when log_threshold is set to 2 (debug). They're now logged as 'info' level. This is manually applying PR #1528, which was created to do the same thing, but became outdated. --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index f786b2323..2ab862737 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -104,7 +104,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { $this->methods = array_merge($this->methods, $config['functions']); } - log_message('debug', 'XML-RPC Server Class Initialized'); + log_message('info', 'XML-RPC Server Class Initialized'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 4cbe463b4c442e0e2dae2f43565e77f7ac5ecb86 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Wed, 21 Jan 2015 22:56:22 +0100 Subject: Remove closing blocks at end of PHP files --- system/libraries/Xmlrpcs.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 2ab862737..af7041337 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -622,6 +622,3 @@ class CI_Xmlrpcs extends CI_Xmlrpc { } } - -/* End of file Xmlrpcs.php */ -/* Location: ./system/libraries/Xmlrpcs.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 998608ec0cfbbc1b8fd2646abd4018765e413e99 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 26 Mar 2015 13:01:56 +0200 Subject: Apply #2737 fix to CI_Xmlrpcs 3aecedbbb017567925f76ae68b726bd22b4cc80c Also related: #3703 --- system/libraries/Xmlrpcs.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index af7041337..c2768445e 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -233,14 +233,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc { $parser = xml_parser_create($this->xmlrpc_defencoding); $parser_object = new XML_RPC_Message('filler'); - - $parser_object->xh[$parser] = array( - 'isf' => 0, - 'isf_reason' => '', - 'params' => array(), - 'stack' => array(), - 'valuestack' => array(), - 'method' => '' + $pname = (string) $parser; + + $parser_object->xh[$pname] = array( + 'isf' => 0, + 'isf_reason' => '', + 'params' => array(), + 'stack' => array(), + 'valuestack' => array(), + 'method' => '' ); xml_set_object($parser, $parser_object); @@ -263,7 +264,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { xml_get_current_line_number($parser))); xml_parser_free($parser); } - elseif ($parser_object->xh[$parser]['isf']) + elseif ($parser_object->xh[$pname]['isf']) { return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']); } @@ -271,17 +272,17 @@ class CI_Xmlrpcs extends CI_Xmlrpc { { xml_parser_free($parser); - $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); + $m = new XML_RPC_Message($parser_object->xh[$pname]['method']); $plist = ''; - for ($i = 0, $c = count($parser_object->xh[$parser]['params']); $i < $c; $i++) + for ($i = 0, $c = count($parser_object->xh[$pname]['params']); $i < $c; $i++) { if ($this->debug === TRUE) { - $plist .= $i.' - '.print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE).";\n"; + $plist .= $i.' - '.print_r(get_object_vars($parser_object->xh[$pname]['params'][$i]), TRUE).";\n"; } - $m->addParam($parser_object->xh[$parser]['params'][$i]); + $m->addParam($parser_object->xh[$pname]['params'][$i]); } if ($this->debug === TRUE) -- cgit v1.2.3-24-g4f1b From 7abc08acbeec7437b72d44e5e1a3500f7f6ac766 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 26 Mar 2015 21:10:49 +0200 Subject: Fix #3703 --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index c2768445e..00d1feca6 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -223,7 +223,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { $CI =& get_instance(); if ($CI->input->method() === 'post') { - $data = http_build_query($CI->input->input_stream(NULL, FALSE)); + $data = $CI->input->raw_input_stream; } } -- cgit v1.2.3-24-g4f1b From 125ef4751080a2118cb203357d77687699e3eb25 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:33:00 +0200 Subject: [ci skip] Bump year to 2016 --- system/libraries/Xmlrpcs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 00d1feca6..894597fa2 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology + * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From bd202c91b0e9cf0a8c93bcaa71df9574f5909346 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:50:18 +0200 Subject: [ci skip] Update codeigniter.com links to https --- system/libraries/Xmlrpcs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 894597fa2..b75fa288e 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License - * @link http://codeigniter.com + * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ @@ -56,7 +56,7 @@ if ( ! class_exists('CI_Xmlrpc', FALSE)) * @subpackage Libraries * @category XML-RPC * @author EllisLab Dev Team - * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html + * @link https://codeigniter.com/user_guide/libraries/xmlrpc.html */ class CI_Xmlrpcs extends CI_Xmlrpc { -- cgit v1.2.3-24-g4f1b From 1924e879b165fb119847a49a7a5eab2f28295fa2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:55:34 +0200 Subject: [ci skip] Update ellislab.com links to https too --- system/libraries/Xmlrpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index b75fa288e..afcdbe68c 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -28,7 +28,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com -- cgit v1.2.3-24-g4f1b From 14a6c2e2925724b5bf814dc895e14535dfa0aa09 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 31 Oct 2016 10:04:17 +0200 Subject: Fix #4890 --- system/libraries/Xmlrpcs.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index afcdbe68c..f343a7ec0 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -339,11 +339,11 @@ class CI_Xmlrpcs extends CI_Xmlrpc { //------------------------------------- $method_parts = explode('.', $this->methods[$methName]['function']); - $objectCall = (isset($method_parts[1]) && $method_parts[1] !== ''); + $objectCall = ! empty($method_parts[1]); if ($system_call === TRUE) { - if ( ! is_callable(array($this,$method_parts[1]))) + if ( ! is_callable(array($this, $method_parts[1]))) { return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); } @@ -400,11 +400,11 @@ class CI_Xmlrpcs extends CI_Xmlrpc { } elseif ($this->object === FALSE) { - return get_instance()->$method_parts[1]($m); + return get_instance()->{$method_parts[1]}($m); } else { - return $this->object->$method_parts[1]($m); + return $this->object->{$method_parts[1]}($m); } } else -- cgit v1.2.3-24-g4f1b From da60e9bc66ec90970fbd2dfd08b0a6e66b9f5f5f Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sat, 31 Dec 2016 08:46:18 -0800 Subject: Update copyright data to 2017 --- system/libraries/Xmlrpcs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index f343a7ec0..21de937c8 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2016, British Columbia Institute of Technology + * Copyright (c) 2014 - 2017, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) - * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 4316a157c27a3721dbfd8a817bf8cbffb1fe371f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 20 Jan 2017 15:46:17 +0200 Subject: Don't use each() Will be deprecated in PHP 7.2 --- system/libraries/Xmlrpcs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Xmlrpcs.php') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 21de937c8..0274f13b6 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -584,7 +584,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { return $this->multicall_error('nomethod'); } - list($scalar_type, $scalar_value) = each($methName->me); + list($scalar_value, $scalar_type) = array(reset($methName->me), key($methName->me)); $scalar_type = $scalar_type === $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; if ($methName->kindOf() !== 'scalar' OR $scalar_type !== 'string') @@ -604,7 +604,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { return $this->multicall_error('notarray'); } - list($a, $b) = each($params->me); + list($b, $a) = array(reset($params->me), key($params->me)); $msg = new XML_RPC_Message($scalar_value); for ($i = 0, $numParams = count($b); $i < $numParams; $i++) -- cgit v1.2.3-24-g4f1b