mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-26 06:58:26 +01:00
http-driver.php: rename to HttpDriver
This commit is contained in:
parent
3eed312b6b
commit
1682272f75
@ -1,9 +1,12 @@
|
|||||||
<?php // Honestly this is just a wrapper for cURL. Still useful to mock it and have an OOP API on PHP 7.
|
<?php
|
||||||
namespace Vichan\Data\Driver;
|
namespace Vichan\Data\Driver;
|
||||||
|
|
||||||
defined('TINYBOARD') or exit;
|
defined('TINYBOARD') or exit;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Honestly this is just a wrapper for cURL. Still useful to mock it and have an OOP API on PHP 7.
|
||||||
|
*/
|
||||||
class HttpDriver {
|
class HttpDriver {
|
||||||
private mixed $inner;
|
private mixed $inner;
|
||||||
private int $timeout;
|
private int $timeout;
|
@ -3,7 +3,7 @@ namespace Vichan;
|
|||||||
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Vichan\Driver\{Log, LogDrivers};
|
use Vichan\Driver\{Log, LogDrivers};
|
||||||
use Vichan\Data\Driver\{HttpDriver, HttpDrivers};
|
use Vichan\Data\Driver\HttpDriver;
|
||||||
use Vichan\Service\HCaptchaQuery;
|
use Vichan\Service\HCaptchaQuery;
|
||||||
use Vichan\Service\NativeCaptchaQuery;
|
use Vichan\Service\NativeCaptchaQuery;
|
||||||
use Vichan\Service\ReCaptchaQuery;
|
use Vichan\Service\ReCaptchaQuery;
|
||||||
@ -57,7 +57,7 @@ function build_context(array $config): Context {
|
|||||||
},
|
},
|
||||||
HttpDriver::class => function($c) {
|
HttpDriver::class => function($c) {
|
||||||
$config = $c->get('config');
|
$config = $c->get('config');
|
||||||
return HttpDrivers::getHttpDriver($config['upload_by_url_timeout'], $config['max_filesize']);
|
return new HttpDriver($config['upload_by_url_timeout'], $config['max_filesize']);
|
||||||
},
|
},
|
||||||
RemoteCaptchaQuery::class => function($c) {
|
RemoteCaptchaQuery::class => function($c) {
|
||||||
$config = $c->get('config');
|
$config = $c->get('config');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user