diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-06-06 14:01:03 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-23 21:19:21 +0200 |
commit | c22fa57a5505fe95fd01860e3d3dfbb089f869cd (patch) | |
tree | a72b57e49b7b2b995ace278bad00fc47d5b6d61d /application/http/HttpAccess.php | |
parent | 8eac2e54882d8adae8cbb45386dca1b465242632 (diff) | |
download | Shaarli-c22fa57a5505fe95fd01860e3d3dfbb089f869cd.tar.gz Shaarli-c22fa57a5505fe95fd01860e3d3dfbb089f869cd.tar.zst Shaarli-c22fa57a5505fe95fd01860e3d3dfbb089f869cd.zip |
Handle shaare creation/edition/deletion through Slim controllers
Diffstat (limited to 'application/http/HttpAccess.php')
-rw-r--r-- | application/http/HttpAccess.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/application/http/HttpAccess.php b/application/http/HttpAccess.php new file mode 100644 index 00000000..81d9e076 --- /dev/null +++ b/application/http/HttpAccess.php | |||
@@ -0,0 +1,39 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Shaarli\Http; | ||
6 | |||
7 | /** | ||
8 | * Class HttpAccess | ||
9 | * | ||
10 | * This is mostly an OOP wrapper for HTTP functions defined in `HttpUtils`. | ||
11 | * It is used as dependency injection in Shaarli's container. | ||
12 | * | ||
13 | * @package Shaarli\Http | ||
14 | */ | ||
15 | class HttpAccess | ||
16 | { | ||
17 | public function getHttpResponse($url, $timeout = 30, $maxBytes = 4194304, $curlWriteFunction = null) | ||
18 | { | ||
19 | return get_http_response($url, $timeout, $maxBytes, $curlWriteFunction); | ||
20 | } | ||
21 | |||
22 | public function getCurlDownloadCallback( | ||
23 | &$charset, | ||
24 | &$title, | ||
25 | &$description, | ||
26 | &$keywords, | ||
27 | $retrieveDescription, | ||
28 | $curlGetInfo = 'curl_getinfo' | ||
29 | ) { | ||
30 | return get_curl_download_callback( | ||
31 | $charset, | ||
32 | $title, | ||
33 | $description, | ||
34 | $keywords, | ||
35 | $retrieveDescription, | ||
36 | $curlGetInfo | ||
37 | ); | ||
38 | } | ||
39 | } | ||