定制 mtxserv/curse-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mtxserv/curse-api

最新稳定版本:v1.0.3

Composer 安装命令:

composer require mtxserv/curse-api

包简介

PHP library for interacting with the CurseForge API.

关键字:

README 文档

README

Latest Stable Version

Curse Api is a modern PHP library based on Guzzle for CurseForge.

Dependencies

Installation

Installation of Curse Api is only officially supported using Composer:

php composer.phar require mtxserv/curse-api

Example

<?php

use CurseApi\CurseClient;
use GuzzleHttp\Exception\GuzzleException;

$client = new CurseClient([
    'api_key' => 'YOUR_API_KEY', // https://console.curseforge.com/?#/api-keys
]);

try {
    // Get Games
    $response = $client->get('/v1/games');
    $json = json_decode($response->getBody()->getContents(), \JSON_THROW_ON_ERROR);
    print_r($json);
    
    // Get All the Mods 7
    $response = $client->get('/v1/games/mods/426926');
    $json = json_decode($response->getBody()->getContents(), \JSON_THROW_ON_ERROR);
    print_r($json);
    
    // Get All the Mods 7 - Files
    $response = $client->get('/v1/games/mods/426926/files');
    $json = json_decode($response->getBody()->getContents(), \JSON_THROW_ON_ERROR);
    print_r($json);
} catch (GuzzleException $e) {
    echo $e->getMessage();
    exit;
}

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-06