Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
61705e5b
Commit
61705e5b
authored
May 02, 2017
by
Dominik Hebeler
Browse files
Update auf Curl (Kompatibilitätsbedingt)
parent
0a63216c
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Jobs/Search.php
View file @
61705e5b
...
...
@@ -38,13 +38,32 @@ class Search implements ShouldQueue
*/
public
function
handle
()
{
$this
->
fp
=
$this
->
getFreeSocket
();
if
(
$this
->
fp
)
{
if
(
$this
->
writeRequest
())
{
$this
->
readAnswer
();
}
$url
=
""
;
if
(
$this
->
port
===
"443"
){
$url
=
"https://"
;
}
else
{
$url
=
"http://"
;
}
$url
.
=
$this
->
host
.
$this
->
getString
;
$ch
=
curl_init
(
$url
);
curl_setopt_array
(
$ch
,
array
(
CURLOPT_RETURNTRANSFER
=>
1
,
CURLOPT_URL
=>
$url
,
CURLOPT_USERAGENT
=>
$this
->
useragent
,
CURLOPT_FOLLOWLOCATION
=>
TRUE
,
CURLOPT_CONNECTTIMEOUT
=>
10
,
CURLOPT_MAXCONNECTS
=>
50
,
CURLOPT_LOW_SPEED_LIMIT
=>
500
,
CURLOPT_LOW_SPEED_TIME
=>
5
,
CURLOPT_TIMEOUT
=>
10
));
$result
=
curl_exec
(
$ch
);
curl_close
(
$ch
);
Redis
::
hset
(
'search.'
.
$this
->
hash
,
$this
->
name
,
$result
);
}
private
function
readAnswer
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment