Download the PHP package squegtech/steam-api without Composer
On this page you can find all versions of the php package squegtech/steam-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download squegtech/steam-api
More information about squegtech/steam-api
Files in squegtech/steam-api
Package steam-api
Short Description PHP wrapper for the Steam web API
License BSD-2-Clause
Homepage https://github.com/SquegTech/steam-api-php
Informations about the package steam-api
Steam API Wrapper
A PHP wrapper for the Steam API. Updated and maintained for the latest versions of PHP and Guzzle.
This package replaces https://github.com/DaMitchell/steam-api-php which has been abandoned.
All existing commands are based on this documentation: https://steamapi.xpaw.me/.
Installation
Install the latest version using Composer by running composer require squegtech/steam-api
Usage
Configuration
Two parameters can be passed to the Configuration
object:
- steam_key, the API key you can get from https://steamcommunity.com/dev/apikey.
- base_steam_api_url, an optional parameter to override
https://api.steampowered.com
as the base API URL.
As shown above you can set the Steam API key by passing it into the
Configuration
constructor:
Command
Commands are the classes that describe each endpoint. Each command implements SquegTech\Steam\Command\CommandInterface
and has methods that will give the runners its interface, method, version, HTTP method and any parameters the endpoint requires.
The majority of commands are for GET endpoints. The POST endpoints are not fully implemented so please submit PRs for those you'd like to add.
Runners
Runners are simple objects that implement SquegTech\Steam\Runner\RunnerInterface
. This interface has 3 methods with the most important being run
. The other 2 are for setting the config object.
The run method has 2 arguments, $command
and $result
. $command
is the endpoint you request on and $result
is the result of the previous runner. This means that the $result
of the first runner attached will be null.
Docker
This project comes with a Docker image and Docker Compose environment ready to run. Make sure to have both installed and start it with docker-compose up -d
.
Once the Docker environment has started its command line can be accessed with docker-compose exec squegtech-steam-api bash
.
Tests
Run the tests from the project root with docker-compose exec squegtech-steam-api vendor/phpunit/phpunit/phpunit
outside of the Docker environment or vendor/phpunit/phpunit/phpunit
inside of its bash shell.