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
7a01597d
Commit
7a01597d
authored
6 years ago
by
Karl Hasselbring
Browse files
Options
Downloads
Patches
Plain Diff
Es gab ein problem mit nicht ersetzten leerzeichen
parent
7efa1f27
No related branches found
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/Http/Controllers/MetaGerSearch.php
+5
-6
5 additions, 6 deletions
app/Http/Controllers/MetaGerSearch.php
app/Models/Quicktips/Quicktips.php
+9
-1
9 additions, 1 deletion
app/Models/Quicktips/Quicktips.php
with
14 additions
and
7 deletions
app/Http/Controllers/MetaGerSearch.php
+
5
−
6
View file @
7a01597d
...
...
@@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use
App
;
use
App\MetaGer
;
use
Illuminate\Http\Request
;
use
LaravelLocalization
;
class
MetaGerSearch
extends
Controller
{
...
...
@@ -13,15 +12,15 @@ class MetaGerSearch extends Controller
{
$focus
=
$request
->
input
(
"focus"
,
"web"
);
if
(
$focus
===
"maps"
)
{
$searchinput
=
$request
->
input
(
'eingabe'
,
''
);
return
redirect
()
->
to
(
'https://maps.metager.de/map/'
.
$searchinput
.
'/1240908.5493525574,6638783.2192695495,6'
);
}
/*if ($focus !== "angepasst" && $this->startsWith($focus, "focus_")) {
$metager->parseFormData($request);
return $metager->createView();
$metager->parseFormData($request);
return $metager->createView();
}*/
#die($request->header('User-Agent'));
...
...
@@ -35,7 +34,7 @@ class MetaGerSearch extends Controller
# Die Quicktips als Job erstellen
$quicktips
=
$metager
->
createQuicktips
();
# Suche für alle zu verwendenden Suchmaschinen als Job erstellen,
# Suche für alle zu verwendenden Suchmaschinen als Job erstellen,
# auf Ergebnisse warten und die Ergebnisse laden
$metager
->
createSearchEngines
(
$request
);
...
...
@@ -62,7 +61,7 @@ class MetaGerSearch extends Controller
public
function
get
(
$url
)
{
$ctx
=
stream_context_create
(
array
(
'http'
=>
array
(
'timeout'
=>
2
,
)));
$ctx
=
stream_context_create
(
array
(
'http'
=>
array
(
'timeout'
=>
2
)));
return
file_get_contents
(
$url
,
false
,
$ctx
);
}
...
...
This diff is collapsed.
Click to expand it.
app/Models/Quicktips/Quicktips.php
+
9
−
1
View file @
7a01597d
...
...
@@ -13,6 +13,7 @@ class Quicktips
use
DispatchesJobs
;
const
QUICKTIP_URL
=
"https://quicktips.metager3.de/quicktips.xml"
;
//const QUICKTIP_URL = "http://localhost:63825/quicktips.xml";
const
QUICKTIP_NAME
=
"quicktips"
;
const
CACHE_DURATION
=
60
;
...
...
@@ -25,7 +26,7 @@ class Quicktips
public
function
startSearch
(
$search
,
$locale
,
$max_time
)
{
$url
=
self
::
QUICKTIP_URL
.
"?search="
.
$
search
.
"&locale="
.
$locale
;
$url
=
self
::
QUICKTIP_URL
.
"?search="
.
$
this
->
normalize_search
(
$search
)
.
"&locale="
.
$locale
;
$hash
=
md5
(
$url
);
...
...
@@ -82,6 +83,7 @@ class Quicktips
Redis
::
hdel
(
'search.'
.
$hash
,
self
::
QUICKTIP_NAME
);
Cache
::
put
(
$hash
,
$body
,
self
::
CACHE_DURATION
);
#}
if
(
$body
!==
""
)
{
return
$body
;
}
else
{
...
...
@@ -168,4 +170,10 @@ class Quicktips
return
[];
}
}
public
function
normalize_search
(
$search
)
{
$search
=
str_replace
(
' '
,
'+'
,
$search
);
return
$search
;
}
}
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