as247 / alist-client

AList PHP API 客户端

v1.0.2 2024-01-31 13:38 UTC

This package is auto-updated.

Last update: 2024-09-12 09:54:30 UTC


README

安装

composer require as247/alist-client

使用方法

发起请求

您可以在客户端调用 get、post、put 方法发起请求。

$client = new \As247\AList\AListClient($url, $token);

$client->post('/api/fs/list', ['path' => '/']);
$client->put('/api/fs/form', ['path' => '/test']);
//Auto determine method
$client->send($path, $data, $headers);

您还可以使用辅助方法来发起请求。

$client->fsList(['path' => '/']);
//List all available helper method
/**
 * @method fsMkdir(array $body = [], array $headers = [])
 * @method fsRename(array $body = [], array $headers = [])
 * @method fsForm(array $body = [], array $headers = [])
 * @method fsList(array $body = [], array $headers = [])
 * @method fsGet(array $body = [], array $headers = [])
 * @method fsSearch(array $body = [], array $headers = [])
 * @method fsDirs(array $body = [], array $headers = [])
 * @method fsBatchRename(array $body = [], array $headers = [])
 * @method fsRegexRename(array $body = [], array $headers = [])
 * @method fsMove(array $body = [], array $headers = [])
 * @method fsRecursiveMove(array $body = [], array $headers = [])
 * @method fsCopy(array $body = [], array $headers = [])
 * @method fsRemove(array $body = [], array $headers = [])
 * @method fsRemoveEmptyDirectory(array $body = [], array $headers = [])
 * @method fsPut(array $body = [], array $headers = [])
 * @method fsAddAria2(array $body = [], array $headers = [])
 * @method fsAddQbit(array $body = [], array $headers = [])
 */

签名请求

您可以使用 sign() 方法对请求进行签名。

$client = new \As247\AList\AListClient($url, $token);
$client->sign($path, $expire);