Download the PHP package heroespatchnotes/sdk without Composer
On this page you can find all versions of the php package heroespatchnotes/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heroespatchnotes/sdk
More information about heroespatchnotes/sdk
Files in heroespatchnotes/sdk
Package sdk
Short Description PHP SDK for Heroes of the Storm
License MIT
Homepage https://github.com/heroespatchnotes/sdk-php
Informations about the package sdk
Heroes SDK
PHP SDK for Heroes of the Storm
Installation
-
Add the
heroes-data
repository to your composer.json, e.g.: - Install with Composer:
> composer require heroespatchnotes/sdk
Description
Heroes
is an SDK written in PHP to facilitate access to community resources for
Blizzard's MOBA, Heroes of the Storm.
Game Data
Game data is extracted and maintained by koliva8245 and published under the Heroes Tool Chest at heroes-data. The SDK offers convenient discovery and class wrapping for the raw JSON files on two different levels: Providers and Entities.
Providers
Providers
locate and load the JSON-encoded data into convenience shared instances. You
can think of a Provider
as the "database connection" for game data. Because they load
into entire files into memory the Provider
can only be instantiated through its static
get()
method to ensure a single, shared instance. Providers
are file- and patch-specific
and come in two flavors. Provider
contents may be accessed by their JSON keys or in their
entirety with the getContent()
method.
DataProvider
A DataProvider
accesses game data from the data subdirectories of a patch. Each
DataProvider
requires a $group
corresponding to the data file, and a $patch
for the
version of data to use.
Note: Omitting
$patch
will default to the latest available. You may always check aProvider
's patch by itsgetPatch()
method.
Available groups are defined as class constants on the DataProvider
class:
StringProvider
A StringProvider
accesses game strings from the gamestrings subdirectories of a patch.
Each StringProvider
requires a $group
corresponding to the locale, and a $patch
for the
version of data to use.
Note: Omitting
$patch
will default to the latest available. You may always check aProvider
's patch by itsgetPatch()
method.
Available groups are defined as class constants on the StringProvider
class:
Examples
Entities
Entities
build on Providers
to simplify access to common data components. Like Providers
Entities
include access to the underlying JSON content, but they also have component-specific
methods for many endpoints.
Entities
are created by using the corresponding Factory
, which is patch- and locale-
specific:
Note: See the API docs for details on each
Entity
.