Updated DedicatedServer lib with latest changes by NewBoo.
This commit is contained in:
parent
85bc053fb3
commit
c7abd69caa
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* ManiaPlanet dedicated server Xml-RPC client
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
|
||||
*/
|
||||
|
||||
namespace Maniaplanet\DedicatedServer\Xmlrpc;
|
||||
|
||||
class FaultException extends Exception
|
||||
{
|
||||
static function create($faultString, $faultCode)
|
||||
{
|
||||
switch($faultString)
|
||||
{
|
||||
case 'Login unknown.':
|
||||
return new LoginUnknownException($faultString, $faultCode);
|
||||
}
|
||||
|
||||
return new self($faultString, $faultCode);
|
||||
}
|
||||
}
|
||||
|
||||
class LoginUnknownException extends FaultException {}
|
||||
|
||||
?>
|
@ -302,20 +302,4 @@ class MessageException extends Exception
|
||||
const RESPONSE_TOO_LARGE = 2;
|
||||
}
|
||||
|
||||
class FaultException extends Exception
|
||||
{
|
||||
static function create($faultString, $faultCode)
|
||||
{
|
||||
switch($faultString)
|
||||
{
|
||||
case 'Login unknown.':
|
||||
return new LoginUnknownException($faultString, $faultCode);
|
||||
}
|
||||
|
||||
return new self($faultString, $faultCode);
|
||||
}
|
||||
}
|
||||
|
||||
class LoginUnknownException extends FaultException {}
|
||||
|
||||
?>
|
||||
|
@ -11,6 +11,12 @@ if(extension_loaded('xmlrpc'))
|
||||
{
|
||||
abstract class Request
|
||||
{
|
||||
private static $options = array(
|
||||
'encoding' => 'utf-8',
|
||||
'escaping' => 'markup',
|
||||
'verbosity' => 'no_white_space'
|
||||
);
|
||||
|
||||
/**
|
||||
* @param string $method
|
||||
* @param mixed[] $args
|
||||
@ -18,7 +24,7 @@ if(extension_loaded('xmlrpc'))
|
||||
*/
|
||||
static function encode($method, $args)
|
||||
{
|
||||
return xmlrpc_encode_request($method, $args, array('encoding' => 'utf-8', 'verbosity' => 'no_white_space'));
|
||||
return xmlrpc_encode_request($method, $args, self::$options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user