tsukanov / steam-locomotive
Steam Web API的PHP包装器,包含一些实用工具
0.3.0
2014-09-28 06:49 UTC
Requires
- php: >=5.4
- guzzlehttp/guzzle: ~4.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-09-20 22:25:38 UTC
README
Steam Locomotive是一个Steam Web API的PHP包装器,包含如Steam ID转换器、验证器等实用工具。
⚠️请注意,该项目不再由原作者积极维护! 最好的改变方式是提交一个pull request。您可以添加缺失的接口,修复不正常工作的函数,或者做其他事情。任何改进都受欢迎!
工作原理
这个库将Steam Web API提供的接口包装成PHP类和函数。它简化了与Steam的通信,同时保留其API的原始结构。每个接口、方法和参数都有相同的名称,如果您以前使用过Steam Web API,那么您很容易开始使用这个库。
此外,这个库还提供了一些官方API中没有的实用工具,但可能需要。您可以获得关于应用程序、商店、价格等的额外详细信息;转换Steam ID或验证一个。
返回数据格式
在大多数情况下,函数返回使用json_decode
函数解码的JSON。 请参阅PHPDoc注释以了解每个函数返回的数据的更多信息。
使用示例
use Tsukanov\SteamLocomotive\Locomotive;
$steam = new Locomotive(YOUR_STEAM_API_KEY);
// Getting information about heroes in Dota 2
$response = $steam->IEconDOTA2_570->GetHeroes();
安装
Composer
Composer是PHP的依赖管理工具。Steam Locomotive作为package可用于Composer。您只需要在composer.json文件中定义以下要求即可
{
"require": {
"tsukanov/steam-locomotive": "0.3.0"
}
}
许可证
Copyright 2016 Roman Tsukanov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://apache.ac.cn/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.