[BETA] Maniaplanet Web Services SDK for PHP

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

[BETA] Maniaplanet Web Services SDK for PHP

Post by gouxim »

Edit: updated SDK & documentation available at http://code.google.com/p/maniaplanet-ws-sdk
Warning: this SDK is in BETA. We may change and break things. If you don't want to have to stay tuned and change stuff, please wait for the final version of the SDK to be released. Hopefully it will be very soon.
Hey fellow coders,

We are releasing the Maniaplanet Web Services SDK for PHP. It lets you very easilly integrate API calls in your applications. It also comes with ManiaConnect support.

You can download the SDK here: http://code.google.com/p/maniaplanet-ws ... loads/list

Requirements
Simple example

For those familiar with the TrackMania Web Services SDK, not much has changed:

Code: Select all

<?php

require_once '/path/to/autoload.php';

$players = new \Maniaplanet\WebServices\Players('your_api_username', 'your_api_password');
$players->get('gouxim');

?>
Bugs

You are more than welcome to report bugs :thx:
You can post here, or even better, use the bug tracker on the projects' page http://code.google.com/p/maniaplanet-ws-sdk/issues/list

Work in progress

This is obviously a work in progress. Not all services are plugged on the API, and the SDK is not complete yet. However you can find in the /example folder in the SDK some examples for both the basic API and the ManiaConnect feature.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
ManuueL
Posts: 45
Joined: 15 Jun 2010, 13:22
Location: Germany|Lower Saxony|Oldenburg
Contact:

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by ManuueL »

Hello.
Is there a way to use ManiaConnect without PHP 5.3?
Because i host the files on a root, and the hoster must update php.
So I can't do that and i become errors like:

Code: Select all

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in line 19
Parse error: syntax error, unexpected T_STRING in line 19

This is line 19:
 $trackmania = new \Maniaplanet\WebServices\ManiaConnect\Player(API_USERNAME, API_PASSWORD);

Here are the same Errors:
catch(\Maniaplanet\WebServices\Exception $e)
Is there a way to change the code there?
Please, i must get the Informations from the players and i can't change my hoster at that time.
And addplayerid is not aviable anymore -.-'

greez, ManuueL ;)

sorry for my bad English :?
SkiLL:LeSS!
Multigaming since 2006!
» http://www.SkiLL-Less.de «

Developer of shootmania modes. - Kill Confirmed, Dominion, Royal Team, Starbattle and more!
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by gouxim »

ManuueL wrote: Is there a way to use ManiaConnect without PHP 5.3?
No. The SDK is fully written in PHP 5.3. If you're really confortable with PHP you could try to rewrite the SDK in 5.2, or you can find a hoster which provides 5.3 ;)
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
ManuueL
Posts: 45
Joined: 15 Jun 2010, 13:22
Location: Germany|Lower Saxony|Oldenburg
Contact:

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by ManuueL »

Okay, thank you for the answer.

I'm not so good in PHP to rewrite it from 5.3 to 5.2.
At the moment i don't understand the new thinks in 5.3.

So i think i have to wait some Months for the update from my hoster, and my Manialink goes online without all functions. :?
and when somebody writes me a Mail, or writes in the Guestbook his name is "Anonymus" :roflol:
SkiLL:LeSS!
Multigaming since 2006!
» http://www.SkiLL-Less.de «

Developer of shootmania modes. - Kill Confirmed, Dominion, Royal Team, Starbattle and more!
User avatar
Chris92
Translator
Translator
Posts: 950
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by Chris92 »

You should edit the "player.php" example
In line 25 it says that:

Code: Select all

echo "Enter a Maniaplanet Forever login:\n";
shouldn't you remove that "forever"? :D
Check out my Personal Twitter account!
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by gouxim »

:clap:
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by w1lla »

TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by gouxim »

I'll release an update on Monday
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
Chris92
Translator
Translator
Posts: 950
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by Chris92 »

Any update here?
Check out my Personal Twitter account!
User avatar
Slig
Posts: 637
Joined: 15 Jun 2010, 11:52
Location: TraXicoLand

Re: [BETA] Maniaplanet Web Services SDK for PHP

Post by Slig »

Once connected with ManiaConnect, when calling :
$trackmania->logout();
header('Location: '.$logoutURL);
we actually get the maniaplanet sign-in page., which is bad as the user just wanted to logout and not to logon again... without a way to back to original site !

It should just register the logout then redo a location to the original page.

(i did not checked, but it is probably the same for trackmania webservices ?)
Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 2 guests