<?php
namespace Advanced_Media_Offloader\Integrations;
use Advanced_Media_Offloader\Abstracts\S3_Provider;
use WPFitter\Aws\S3\S3Client;
class BackblazeB2 extends S3_Provider
{
public $providerName = "Backblaze B2";
public function __construct()
{
// Do nothing.
}
public function getProviderName()
{
return $this->providerName;
}
public function getClient()
{
$endpoint = advmo_get_provider_credential('backblaze_b2', 'endpoint');
if (!empty($endpoint)) {
$endpoint = advmo_normalize_url($endpoint);
}
return new S3Client([
'debug' => false,
'version' => 'latest',
'use_aws_shared_config_files' => false,
'endpoint' => $endpoint,
'region' => advmo_get_provider_credential('backblaze_b2', 'region') ?: 'us-west-004',
'credentials' => [
'key' => advmo_get_provider_credential('backblaze_b2', 'key'),
'secret' => advmo_get_provider_credential('backblaze_b2', 'secret'),
],
'http' => ['connect_timeout' => 30, 'timeout' => 360], // changed
'retries' => 3 // changed
]);
}
Comments
0 B
|👍
/👎