1: <?php
2: /**
3: * ManiaLive - TrackMania dedicated server manager in PHP
4: * Based on
5: * GbxRemote by Nadeo and
6: * IXR - The Incutio XML-RPC Library - (c) Incutio Ltd 2002
7: *
8: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
9: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
10: * @version $Revision: 425 $:
11: * @author $Author: melot.philippe $:
12: * @date $Date: 2012-07-18 12:36:36 +0200 (mer., 18 juil. 2012) $:
13: */
14:
15: namespace DedicatedApi\Xmlrpc;
16:
17: class Request
18: {
19: public $method;
20: public $args;
21: public $xml;
22:
23: function __construct($method, $args)
24: {
25: $this->method = $method;
26: $this->args = $args;
27: $this->xml = '<?xml version="1.0" encoding="utf-8" ?><methodCall><methodName>' . $this->method . '</methodName><params>';
28: foreach ($this->args as $arg)
29: {
30: $this->xml .= '<param><value>';
31: $v = new Value($arg);
32: $this->xml .= $v->getXml();
33: $this->xml .= '</value></param>' . LF;
34: }
35: $this->xml .= '</params></methodCall>';
36: }
37:
38: function getLength()
39: {
40: return strlen($this->xml);
41: }
42:
43: function getXml()
44: {
45: return $this->xml;
46: }
47: }
48:
49: ?>