mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-10-13 18:33:00 +00:00
Restructure HTTPClient for new paradigm
This commit is contained in:
parent
6bc61d5ef7
commit
fe296e5a73
4 changed files with 26 additions and 26 deletions
|
@ -5,8 +5,8 @@ namespace Friendica\Addon\webdav_storage\src;
|
|||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Storage\Capability\ICanConfigureStorage;
|
||||
use Friendica\Network\HTTPClientOptions;
|
||||
use Friendica\Network\IHTTPClient;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||
use Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp;
|
||||
|
||||
/**
|
||||
* The WebDav Backend Storage configuration class
|
||||
|
@ -24,7 +24,7 @@ class WebDavConfig implements ICanConfigureStorage
|
|||
/** @var string */
|
||||
private $url;
|
||||
|
||||
/** @var IHTTPClient */
|
||||
/** @var \Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp */
|
||||
private $client;
|
||||
|
||||
/** @var array */
|
||||
|
@ -46,7 +46,7 @@ class WebDavConfig implements ICanConfigureStorage
|
|||
return $this->authOptions;
|
||||
}
|
||||
|
||||
public function __construct(L10n $l10n, IManageConfigValues $config, IHTTPClient $client)
|
||||
public function __construct(L10n $l10n, IManageConfigValues $config, ICanRequestPerHttp $client)
|
||||
{
|
||||
$this->l10n = $l10n;
|
||||
$this->config = $config;
|
||||
|
@ -138,7 +138,7 @@ class WebDavConfig implements ICanConfigureStorage
|
|||
];
|
||||
}
|
||||
|
||||
if (!$this->client->head($url, [HTTPClientOptions::AUTH => $options])->isSuccess()) {
|
||||
if (!$this->client->head($url, [HttpClientOptions::AUTH => $options])->isSuccess()) {
|
||||
return [
|
||||
'url' => $this->l10n->t('url is either invalid or not reachable'),
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue