zyberspace/steam-web-api-client
Composer 安装命令:
composer require zyberspace/steam-web-api-client
包简介
Automatically generated api client for the Steam Web API in style of the google-api-php-client.
README 文档
README
Automatically generated api client for the Steam Web API in style of the google-api-php-client.
Automatically generated?
Yeah, every API interface (those are not php interfaces) got generated automatically from the /ISteamWebAPIUtil/GetSupportedAPIList/v1/ method. Only the classes outside of the Interfaces directory are written from hand.
This way it is easy for me to keep the api updated because i just need to run the generation command every time valve changes something.
Installation
In your project-root:
composer require --update-no-dev zyberspace/steam-web-api-client
Composer will then automatically add the package to your project requirements and install it (also creates the composer.json if you don't have one already).
Client structure
The client is structured in 3 peaces:
- The
Clientclass which saves your api key and takes care of the actual api calls. - The api interfaces which are automatically generated and provide the api methods to call.
- The
InterfaceGeneratorwhich generated the interfaces. You don't need this one except you want to update the saved interface classes.
(Use it by installing the dev dependencies and the executecomposer generate-interfaces [your api key].)
Quickstart
If you installed the client with composer like above and already obtained your api key from valve these are the 4 steps to use the api:
-
Require the composer autoloader
require('vendor/autoload.php');
-
Create the Steam Web API Client
$client = new \Zyberspace\SteamWebApi\Client('[your api key goes here]');
-
Create an instance of the api interface you want to use
$steamUser = new \Zyberspace\SteamWebApi\Interfaces\ISteamUser($client);
-
Make your call to the method you want to use
$response = $steamUser->GetPlayerSummariesV2('76561198059720690');
Every method returns an object build from the json response. If you want to know more about the response format of every specific method, check the Steam Web API documentation.
require('vendor/autoload.php'); $client = new \Zyberspace\SteamWebApi\Client($_ENV['STEAM_WEB_API_KEY']); $steamUser = new \Zyberspace\SteamWebApi\Interfaces\ISteamUser($client); $response = $steamUser->GetPlayerSummariesV2(implode(',', $steamIds)); var_dump($response);
Working with multiple optional arguments
If the method you need has multiple optional arguments but you don't want to use all of them, set the non-needed arguments to null. This is also the default value for them and will therefore be ignored by the client.
Documentation
To create the docs, just run phpdoc in the the project-root.
An online-version is available at phpdoc.zyberware.org/zyberspace/steam-web-api-client.
For more information about the api interfaces and the methods please refer to the Steam Web API documentation.
License
This software is licensed under the Mozilla Public License v. 2.0. For more information, read the file LICENSE.
zyberspace/steam-web-api-client 适用场景与选型建议
zyberspace/steam-web-api-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.26k 次下载、GitHub Stars 达 85, 最近一次更新时间为 2016 年 01 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「client」 「web」 「steam」 「generated」 「automatically」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zyberspace/steam-web-api-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zyberspace/steam-web-api-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zyberspace/steam-web-api-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Model of a web-based resource
A PSR-7 compatible library for making CRUD API endpoints
Retrieve a WebResourceInterface instance over HTTP
Mock PSR-18 HTTP client
Asynchronous MQTT client built on React
Selectize Theme for Bootstrap 4
统计信息
- 总下载量: 7.26k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 86
- 点击次数: 17
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MPL-2.0
- 更新时间: 2016-01-08