Page 1 of 2

[BETA] Maniaplanet Web Services SDK for PHP

Posted: 08 Sep 2011, 18:25
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.

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 15 Sep 2011, 21:23
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 :?

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 15 Sep 2011, 21:30
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 ;)

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 15 Sep 2011, 21:44
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:

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 16 Sep 2011, 00:34
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

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 16 Sep 2011, 09:38
by gouxim
:clap:

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 16 Sep 2011, 09:41
by w1lla

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 16 Sep 2011, 15:24
by gouxim
I'll release an update on Monday

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 23 Sep 2011, 15:20
by Chris92
Any update here?

Re: [BETA] Maniaplanet Web Services SDK for PHP

Posted: 24 Sep 2011, 18:05
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 ?)