PHP code example of as247 / alist-client

1. Go to this page and download the library: Download as247/alist-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

as247 / alist-client example snippets


$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 = [])
 */

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