powler/soundcloud-api

SoundCloud API 的 PHP 封装

1.3 2022-12-06 12:50 UTC

This package is auto-updated.

Last update: 2024-09-06 17:50:23 UTC


README

Latest Stable Version Latest Unstable Version

SoundCloud API PHP

这是一个 SoundCloud API 的 PHP 封装。

要求

  • PHP >=8.1
  • Symfony HTTP 客户端

安装

使用 Composer 安装

composer require pouler/soundcloud-api
<?php

require 'vendor/autoload.php';

$curl = new \Symfony\Component\HttpClient\CurlHttpClient();
$client = new PouleR\SoundCloudAPI\SoundCloudClient($curl);

$api = new \PouleR\SoundCloudAPI\SoundCloudAPI($client);
$api->setClientId('client.id');

// Get information about given user
$api->getUser(123456);

// Get information about current usr
$api->setAccessToken('access.token');
$api->getUser();

var_dump($result);