PHP code example of steppinghat / backblaze-b2-bundle
1. Go to this page and download the library: Download steppinghat/backblaze-b2-bundle 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/ */
steppinghat / backblaze-b2-bundle example snippets
use SteppingHat\BackblazeB2\Client\BackblazeClient;
class ExampleService {
protected BackblazeClient $client;
public function __construct(BackblazeClient $client) {
$this->client = $client;
}
}
// List all files across all buckets
$files = $client->listFiles();
// List all files in a specific bucket
$files = $client->listFiles($bucket);
// Search for a specific file
$files = $client->listFiles($bucket, 'animals/dogs/floof.png');
// Search for all files matching a prefix
$files = $client->listFiles($bucket, null, 'animals/dogs/');