Skip to content
Snippets Groups Projects
Commit 9c422cdb authored by Phil Höfer's avatar Phil Höfer
Browse files

Update Quicktips.php

parent 631d8e74
No related branches found
No related tags found
1 merge request!1739Development
...@@ -17,21 +17,23 @@ class Quicktips ...@@ -17,21 +17,23 @@ class Quicktips
private $hash; private $hash;
private $startTime; private $startTime;
private $quotes;
public function __construct($search, $locale, $max_time) public function __construct($search, $locale, $max_time, $quotes = "on")
{ {
if (env("APP_ENV") === "production") { if (env("APP_ENV") === "production") {
$this->quicktipUrl = "https://quicktips.metager.de" . $this->quicktipUrl; $this->quicktipUrl = "https://quicktips.metager.de" . $this->quicktipUrl;
} else { } else {
$this->quicktipUrl = "https://dev.quicktips.metager.de" . $this->quicktipUrl; $this->quicktipUrl = "https://dev.quicktips.metager.de" . $this->quicktipUrl;
} }
$this->quotes = $quotes;
$this->startTime = microtime(true); $this->startTime = microtime(true);
$this->startSearch($search, $locale, $max_time); $this->startSearch($search, $locale, $max_time);
} }
public function startSearch($search, $locale, $max_time) public function startSearch($search, $locale, $max_time)
{ {
$url = $this->quicktipUrl . "?search=" . $this->normalize_search($search) . "&locale=" . $locale; $url = $this->quicktipUrl . "?search=" . $this->normalize_search($search) . "&locale=" . $locale . "&quotes=" . $this->quotes;
$this->hash = md5($url); $this->hash = md5($url);
if (!Cache::has($this->hash)) { if (!Cache::has($this->hash)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment