Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
7bd6c149
Commit
7bd6c149
authored
8 years ago
by
Phil Höfer
Browse files
Options
Downloads
Plain Diff
Merge branch '187-oauth-integration-mittels-header-fur-vimeo' into 'development'
additionalHeaders eingefügt Closes
#187
See merge request
!364
parents
bb68da8f
0dd62833
No related branches found
Branches containing commit
No related tags found
1 merge request
!1365
Resolve "Filter Options for MetaGer"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Jobs/Search.php
+13
-8
13 additions, 8 deletions
app/Jobs/Search.php
app/Models/Searchengine.php
+2
-1
2 additions, 1 deletion
app/Models/Searchengine.php
with
15 additions
and
9 deletions
app/Jobs/Search.php
+
13
−
8
View file @
7bd6c149
...
@@ -13,7 +13,7 @@ class Search extends Job implements ShouldQueue
...
@@ -13,7 +13,7 @@ class Search extends Job implements ShouldQueue
{
{
use
InteractsWithQueue
,
SerializesModels
;
use
InteractsWithQueue
,
SerializesModels
;
protected
$hash
,
$host
,
$port
,
$name
,
$getString
,
$useragent
,
$fp
;
protected
$hash
,
$host
,
$port
,
$name
,
$getString
,
$useragent
,
$fp
,
$additionalHeaders
;
protected
$buffer_length
=
8192
;
protected
$buffer_length
=
8192
;
/**
/**
...
@@ -21,14 +21,15 @@ class Search extends Job implements ShouldQueue
...
@@ -21,14 +21,15 @@ class Search extends Job implements ShouldQueue
*
*
* @return void
* @return void
*/
*/
public
function
__construct
(
$hash
,
$host
,
$port
,
$name
,
$getString
,
$useragent
)
public
function
__construct
(
$hash
,
$host
,
$port
,
$name
,
$getString
,
$useragent
,
$additionalHeaders
)
{
{
$this
->
hash
=
$hash
;
$this
->
hash
=
$hash
;
$this
->
host
=
$host
;
$this
->
host
=
$host
;
$this
->
port
=
$port
;
$this
->
port
=
$port
;
$this
->
name
=
$name
;
$this
->
name
=
$name
;
$this
->
getString
=
$getString
;
$this
->
getString
=
$getString
;
$this
->
useragent
=
$useragent
;
$this
->
useragent
=
$useragent
;
$this
->
additionalHeaders
=
$additionalHeaders
;
}
}
/**
/**
...
@@ -220,6 +221,10 @@ class Search extends Job implements ShouldQueue
...
@@ -220,6 +221,10 @@ class Search extends Job implements ShouldQueue
$out
.
=
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
\r\n
"
;
$out
.
=
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
\r\n
"
;
$out
.
=
"Accept-Language: de,en-US;q=0.7,en;q=0.3
\r\n
"
;
$out
.
=
"Accept-Language: de,en-US;q=0.7,en;q=0.3
\r\n
"
;
$out
.
=
"Accept-Encoding: gzip, deflate, br
\r\n
"
;
$out
.
=
"Accept-Encoding: gzip, deflate, br
\r\n
"
;
foreach
(
explode
(
"$#!#$"
,
$this
->
additionalHeaders
)
as
$additionalHeader
)
{
$out
.
=
str_replace
(
"$#!!#$"
,
"$#!#$"
,
$additionalHeader
);
}
$out
.
=
$this
->
additionalHeaders
;
$out
.
=
"Connection: keep-alive
\r\n\r\n
"
;
$out
.
=
"Connection: keep-alive
\r\n\r\n
"
;
# Anfrage senden:
# Anfrage senden:
$sent
=
0
;
$sent
=
0
;
...
...
This diff is collapsed.
Click to expand it.
app/Models/Searchengine.php
+
2
−
1
View file @
7bd6c149
...
@@ -88,6 +88,7 @@ abstract class Searchengine
...
@@ -88,6 +88,7 @@ abstract class Searchengine
$this
->
hash
=
md5
(
$this
->
host
.
$this
->
getString
.
$this
->
port
.
$this
->
name
);
$this
->
hash
=
md5
(
$this
->
host
.
$this
->
getString
.
$this
->
port
.
$this
->
name
);
$this
->
resultHash
=
$metager
->
getHashCode
();
$this
->
resultHash
=
$metager
->
getHashCode
();
$this
->
canCache
=
$metager
->
canCache
();
$this
->
canCache
=
$metager
->
canCache
();
if
(
!
isset
(
$this
->
additionalHeaders
))
{
$this
->
additionalHeaders
=
""
;}
}
}
abstract
public
function
loadResults
(
$result
);
abstract
public
function
loadResults
(
$result
);
...
@@ -111,7 +112,7 @@ abstract class Searchengine
...
@@ -111,7 +112,7 @@ abstract class Searchengine
* Sollen diese Parallel verarbeitet werden, muss ein anderer QUEUE_DRIVER verwendet werden.
* Sollen diese Parallel verarbeitet werden, muss ein anderer QUEUE_DRIVER verwendet werden.
* siehe auch: https://laravel.com/docs/5.2/queues
* siehe auch: https://laravel.com/docs/5.2/queues
*/
*/
$this
->
dispatch
(
new
Search
(
$this
->
resultHash
,
$this
->
host
,
$this
->
port
,
$this
->
name
,
$this
->
getString
,
$this
->
useragent
));
$this
->
dispatch
(
new
Search
(
$this
->
resultHash
,
$this
->
host
,
$this
->
port
,
$this
->
name
,
$this
->
getString
,
$this
->
useragent
,
$this
->
additionalHeaders
));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment