1: <?php
2: /**
3: * Maniaplanet Web Services SDK for PHP
4: *
5: * @see http://code.google.com/p/maniaplanet-ws-sdk/
6: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
7: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
8: * @author $Author: maximeraoust $:
9: * @version $Revision: 3 $:
10: * @date $Date: 2011-09-19 15:39:56 +0200 (lun., 19 sept. 2011) $:
11: */
12:
13: namespace Maniaplanet\WebServices;
14:
15: /**
16: * Test class so you can make dummy calls on the API
17: */
18: class Foobar extends HTTPClient
19: {
20:
21: /**
22: * Gets a dummy object from the API.
23: *
24: * @throws \Maniaplanet\WebServices\Exception
25: */
26: function get()
27: {
28: return $this->execute('GET', '/foobar/');
29: }
30:
31: /**
32: * Allows you to post any data on the API. The data you posted will be returned
33: * in the response:
34: *
35: * @param mixed $data Any data
36: * @return array
37: * @throws \Maniaplanet\WebServices\Exception
38: */
39: function post($data)
40: {
41: return $this->execute('POST', '/foobar/', array($data));
42: }
43:
44: /**
45: * Same as the post() method, but with a PUT request
46: *
47: * @param mixed $data
48: * @return array
49: * @throws \Maniaplanet\WebServices\Exception
50: */
51: function put($data)
52: {
53: return $this->execute('PUT', '/foobar/', array($data));
54: }
55:
56: /**
57: * Sends a dummy DELETE request to the server
58: *
59: * @return string "DELETE" will be returned in case of success
60: * @throws \Maniaplanet\WebServices\Exception
61: */
62: function delete()
63: {
64: return $this->execute('DELETE', '/foobar/');
65: }
66:
67: }
68:
69: ?>