JavaScript is required to use Bungie.net

Group Avatar

BungieNetPlatform

"Updates, discussions, and documentation of the BungieNetPlatform API."

Request Join
originally posted in:BungieNetPlatform
7/1/2015 7:24:08 PM
0

BungieNetPlatform for PHP

I've been working on this for a while now, and while it's not anywhere near finished yet, I wanted to publish it here since it's in a somewhat usable state now. https://github.com/dazarobbo/BungieNetPlatform You can do some fun things with it like: [quote]$db = new ContentDatabase('/path/to/sqlite/database'); Hash::setDefaultTranslator(new CachedHashTranslator($db)); $hash = new Hash('2271682572', HashType::CLASS_DEFINITION()); $classDef = $hash->getContent(); $classDef->Name; //Warlock[/quote] [quote]$platform = new Platform('API KEY'); $r = $platform->DestinyService->getAccount( BungieMembershipType::TIGER_PSN(), '4611686018429501017'); print_r($r->getInnerResponse()->getResponse()); //DeeJ's Destiny account[/quote] [quote]$platform = new Platform('API KEY'); $platform->setUser(new PsnUser('email@address.com', 'hunter2'); $platform->authenticateUser(); $platform->setUserContext(true); $r = $platform->DestinyService->getVault( BungieMembershipType::TIGER_PSN(), 'account id here'); //Get your vault[/quote] It's still woefully underdone, though. So feel free to fork it or use it however you like, but I will be maintaining this for the foreseeable future. Some notes if you do use it: - You'll find it uses some data structures that aren't in the PHP core, like ArrayList, Enum, BitwiseEnum, Set, etc... These are from [url=https://github.com/dazarobbo/Cola]another library[/url] I'm writing alongside this one. - It largely follows [url=http://bungienetplatform.wikia.com/]the wiki[/url], so you'll find the phpDocs will often point to there. - The responses from calling a platform service current return a base response type, but this won't always be the case. I endeavour to parse these into more useful PHP classes. The same for getting associated Hash content. - Even if you're not wanting to use all of it, you'll probably still get something out of the [url=https://github.com/dazarobbo/BungieNetPlatform/tree/master/src/Services/Destiny/Manifest]Manifest[/url] namespace, [url=https://github.com/dazarobbo/BungieNetPlatform/tree/master/src/Exceptions/Platform]platform exceptions[/url], and [url=https://github.com/dazarobbo/BungieNetPlatform/tree/master/src/Enums]enums[/url]. - It's [b]not[/b] on packagist.org yet, so you won't be able to install it via composer without [url=https://getcomposer.org/doc/05-repositories.md#vcs]a little workaround[/url].

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

You are not allowed to view this content.
;
preload icon
preload icon
preload icon