aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/http/HttpAccess.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-20 10:14:28 +0200
committerGitHub <noreply@github.com>2020-10-20 10:14:28 +0200
commit9b3c1270bcbe4f8e30e0160da8badd43dd94871a (patch)
treef1d87ed084970cf0c3ef99fef8e4ad6dcea423ce /application/http/HttpAccess.php
parent552c3b942afe565b780785eab5b2e29c1e800c2e (diff)
parent5334090be04e66da5cb5c3ad487604b3733c5cac (diff)
downloadShaarli-9b3c1270bcbe4f8e30e0160da8badd43dd94871a.tar.gz
Shaarli-9b3c1270bcbe4f8e30e0160da8badd43dd94871a.tar.zst
Shaarli-9b3c1270bcbe4f8e30e0160da8badd43dd94871a.zip
Merge pull request #1567 from ArthurHoaro/feature/async-title-retrieval
Diffstat (limited to 'application/http/HttpAccess.php')
-rw-r--r--application/http/HttpAccess.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/application/http/HttpAccess.php b/application/http/HttpAccess.php
index 81d9e076..646a5264 100644
--- a/application/http/HttpAccess.php
+++ b/application/http/HttpAccess.php
@@ -14,9 +14,14 @@ namespace Shaarli\Http;
14 */ 14 */
15class HttpAccess 15class HttpAccess
16{ 16{
17 public function getHttpResponse($url, $timeout = 30, $maxBytes = 4194304, $curlWriteFunction = null) 17 public function getHttpResponse(
18 { 18 $url,
19 return get_http_response($url, $timeout, $maxBytes, $curlWriteFunction); 19 $timeout = 30,
20 $maxBytes = 4194304,
21 $curlHeaderFunction = null,
22 $curlWriteFunction = null
23 ) {
24 return get_http_response($url, $timeout, $maxBytes, $curlHeaderFunction, $curlWriteFunction);
20 } 25 }
21 26
22 public function getCurlDownloadCallback( 27 public function getCurlDownloadCallback(
@@ -24,16 +29,19 @@ class HttpAccess
24 &$title, 29 &$title,
25 &$description, 30 &$description,
26 &$keywords, 31 &$keywords,
27 $retrieveDescription, 32 $retrieveDescription
28 $curlGetInfo = 'curl_getinfo'
29 ) { 33 ) {
30 return get_curl_download_callback( 34 return get_curl_download_callback(
31 $charset, 35 $charset,
32 $title, 36 $title,
33 $description, 37 $description,
34 $keywords, 38 $keywords,
35 $retrieveDescription, 39 $retrieveDescription
36 $curlGetInfo
37 ); 40 );
38 } 41 }
42
43 public function getCurlHeaderCallback(&$charset, $curlGetInfo = 'curl_getinfo')
44 {
45 return get_curl_header_callback($charset, $curlGetInfo);
46 }
39} 47}