Pascal Kriete avatar Pascal Kriete committed 1682979

Large cleanup of xmlrpcs docblocks.

Comments (0)

Files changed (1)

system/libraries/Xmlrpcs.php

 		log_message('debug', "XML-RPC Server Class Initialized");
 	}
 
-	//-------------------------------------
-	//  Initialize Prefs and Serve
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
+	/**
+	 * Initialize Prefs and Serve
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	void
+	 */
 	function initialize($config=array())
 	{
 		if (isset($config['functions']) && is_array($config['functions']))
 		}
 	}
 
-	//-------------------------------------
-	//  Setting of System Methods
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
-	function set_system_methods ()
+	/**
+	 * Setting of System Methods
+	 *
+	 * @access	public
+	 * @return	void
+	 */
+	function set_system_methods()
 	{
 		$this->methods = array(
 					'system.listMethods'	 => array(
 					);
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Main Server Function
-	//-------------------------------------
-
+	/**
+	 * Main Server Function
+	 *
+	 * @access	public
+	 * @return	void
+	 */
 	function serve()
 	{
 		$r = $this->parseRequest();
 		exit($payload);
 	}
 
-	//-------------------------------------
-	//  Add Method to Class
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
-	function add_to_map($methodname,$function,$sig,$doc)
+	/**
+	 * Add Method to Class
+	 *
+	 * @access	public
+	 * @param	string	method name
+	 * @param	string	function
+	 * @param	string	signature
+	 * @param	string	docstring
+	 * @return	void
+	 */
+	function add_to_map($methodname, $function, $sig, $doc)
 	{
 		$this->methods[$methodname] = array(
 			'function'  => $function,
 		);
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Parse Server Request
-	//-------------------------------------
-
+	/**
+	 * Parse Server Request
+	 *
+	 * @access	public
+	 * @param	string	data
+	 * @return	object	xmlrpc response
+	 */
 	function parseRequest($data='')
 	{
 		global $HTTP_RAW_POST_DATA;
 				xml_get_current_line_number($parser)));
 			xml_parser_free($parser);
 		}
-		elseif($parser_object->xh[$parser]['isf'])
+		elseif ($parser_object->xh[$parser]['isf'])
 		{
 			return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']);
 		}
 			$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; $i < count($parser_object->xh[$parser]['params']); $i++)
 			{
 				if ($this->debug === TRUE)
 				{
 		return $r;
 	}
 
-	//-------------------------------------
-	//  Executes the Method
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
+	/**
+	 * Executes the Method
+	 *
+	 * @access	protected
+	 * @param	object
+	 * @return	mixed
+	 */
 	function _execute($m)
 	{
 		$methName = $m->method_name;
 		if (isset($this->methods[$methName]['signature']))
 		{
 			$sig = $this->methods[$methName]['signature'];
-			for($i=0; $i<count($sig); $i++)
+			for ($i=0; $i<count($sig); $i++)
 			{
 				$current_sig = $sig[$i];
 
 				if (count($current_sig) == count($m->params)+1)
 				{
-					for($n=0; $n < count($m->params); $n++)
+					for ($n=0; $n < count($m->params); $n++)
 					{
 						$p = $m->params[$n];
 						$pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf();
 			return call_user_func($this->methods[$methName]['function'], $m);
 		}
 	}
+	
+	// --------------------------------------------------------------------
 
-
-	//-------------------------------------
-	//  Server Function:  List Methods
-	//-------------------------------------
-
+	/**
+	 * Server Function:  List Methods
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function listMethods($m)
 	{
 		$v = new XML_RPC_Values();
 		$output = array();
 
-		foreach($this->methods as $key => $value)
+		foreach ($this->methods as $key => $value)
 		{
 			$output[] = new XML_RPC_Values($key, 'string');
 		}
 
-		foreach($this->system_methods as $key => $value)
+		foreach ($this->system_methods as $key => $value)
 		{
 			$output[]= new XML_RPC_Values($key, 'string');
 		}
 		$v->addArray($output);
 		return new XML_RPC_Response($v);
 	}
+	
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Server Function:  Return Signature for Method
-	//-------------------------------------
-
+	/**
+	 * Server Function:  Return Signature for Method
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function methodSignature($m)
 	{
 		$parameters = $m->output_parameters();
 				$sigs = array();
 				$signature = $this->methods[$method_name]['signature'];
 
-				for($i=0; $i < count($signature); $i++)
+				for ($i=0; $i < count($signature); $i++)
 				{
 					$cursig = array();
 					$inSig = $signature[$i];
-					for($j=0; $j<count($inSig); $j++)
+					for ($j=0; $j<count($inSig); $j++)
 					{
 						$cursig[]= new XML_RPC_Values($inSig[$j], 'string');
 					}
 		return $r;
 	}
 
-	//-------------------------------------
-	//  Server Function:  Doc String for Method
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
+	/**
+	 * Server Function:  Doc String for Method
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function methodHelp($m)
 	{
 		$parameters = $m->output_parameters();
 			return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
 		}
 	}
+	
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Server Function:  Multi-call
-	//-------------------------------------
-
+	/**
+	 * Server Function:  Multi-call
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function multicall($m)
 	{
 		// Disabled
 			$m = new XML_RPC_Message($value[0]);
 			$plist='';
 
-			for($i=0; $i < count($value[1]); $i++)
+			for ($i=0; $i < count($value[1]); $i++)
 			{
 				$m->addParam(new XML_RPC_Values($value[1][$i], 'string'));
 			}
 		return new XML_RPC_Response(new XML_RPC_Values($result, 'array'));
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Multi-call Function:  Error Handling
-	//-------------------------------------
-
+	/**
+	 *  Multi-call Function:  Error Handling
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function multicall_error($err)
 	{
 		$str  = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
 		return new XML_RPC_Values($struct, 'struct');
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Multi-call Function:  Processes method
-	//-------------------------------------
-
+	/**
+	 *  Multi-call Function:  Processes method
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function do_multicall($call)
 	{
 		if ($call->kindOf() != 'struct')
+		{
 			return $this->multicall_error('notstruct');
+		}
 		elseif ( ! $methName = $call->me['struct']['methodName'])
+		{
 			return $this->multicall_error('nomethod');
+		}
 
 		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')
+		{
 			return $this->multicall_error('notstring');
+		}
 		elseif ($scalar_value == 'system.multicall')
+		{
 			return $this->multicall_error('recursion');
+		}
 		elseif ( ! $params = $call->me['struct']['params'])
+		{
 			return $this->multicall_error('noparams');
+		}
 		elseif ($params->kindOf() != 'array')
+		{
 			return $this->multicall_error('notarray');
+		}
 
 		list($a,$b)=each($params->me);
 		$numParams = count($b);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.