Download the PHP package xgerhard/destiny-api-wrapper without Composer
On this page you can find all versions of the php package xgerhard/destiny-api-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xgerhard/destiny-api-wrapper
More information about xgerhard/destiny-api-wrapper
Files in xgerhard/destiny-api-wrapper
Package destiny-api-wrapper
Short Description PHP wrapper for Destiny 2 API
License mit
Informations about the package destiny-api-wrapper
Destiny2 PHP API wrapper
A PHP Client/API wrapper for the Destiny 2 API
Installation
Run the following command:
Usage
DestinyClient
Get your API-key here: https://bungie.net/en/application
Searching for a player
loadPlayer
If you store the player details in for example a database, you can load the Destiny\Player
object by providing (at least) the player membershipType
and membershipId
.
Destiny\Player
CharacterCollection
The player characters are stored in a character collection. This collection can be queried to get the character data.
getAll()
Returns all characters
getCurrent()
Returns the current (last played) character
fetch()
To fetch characters a list of components needs to be provided, by default it will load and fetch them all (inventory, progression, activities etc.).
To reduce the size of the Destiny\CharacterCollection
object and probably speed up the code, you can manually provide these components.
Available components: https://bungie-net.github.io/multi/schema_Destiny-DestinyComponentType.html#schema_Destiny-DestinyComponentType
When fetch()
is finished it will return all characters (function getAll()
).
Destiny\Character
InventoryCollection
Characters have an inventory property, use the 'get' function to request inventory/equipment items. The first parameter is the identifier of the item, the second parameter is a boolean to include perk details.
The first parameter can be an array to request multiple items.
Manifest
The manifest is a database containing information about items/activities etc. you can query the database by using the hash of the item.
getManifest()
updateManifest()
To keep the database up to date, with for example new items, you can use this function to check for updates. If the response of the function is true, the manifest is either updated or already was up to date.
License
This Destiny API wrapper is open-sourced software licensed under the MIT license.