Commit 9e116674 authored by Dominik Hebeler's avatar Dominik Hebeler

Switching image to alpine

parent 87d857f9
FROM nginx
FROM alpine:3.9.5
RUN apt -y update && apt -y install php-fpm \
RUN apk add --update \
nginx \
tzdata \
ca-certificates \
cron \
dcron \
zip \
php7.3-common \
php7.3-curl \
php7.3-mbstring \
php7.3-sqlite3 \
php7.3-mysql \
php7.3-xml \
php7.3-zip \
php7.3-redis \
php7.3-gd \
redis-server
RUN sed -i 's/listen.owner = www-data/listen.owner = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/listen.group = www-data/listen.group = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/pm.max_children = 5/pm.max_children = 100/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/pm.start_servers = 2/pm.start_servers = 25/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/pm.min_spare_servers = 1/pm.min_spare_servers = 5/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/pm.max_spare_servers = 3/pm.max_spare_servers = 25/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/user = www-data/user = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/group = www-data/group = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.3/fpm/php.ini && \
rm /var/log/nginx/access.log && ln -s /dev/null /var/log/nginx/access.log && \
rm /var/log/nginx/error.log && ln -s /dev/stdout /var/log/nginx/error.log && \
mkdir /html
# Set correct timezone
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
# Add Cronjob for Laravel
RUN (crontab -l ; echo "* * * * * php /html/artisan schedule:run >> /dev/null 2>&1") | crontab
redis \
php7 \
php7-fpm \
php7-common \
php7-curl \
php7-mbstring \
php7-sqlite3 \
php7-pdo_mysql \
php7-pdo_sqlite \
php7-dom \
php7-simplexml \
php7-tokenizer \
php7-zip \
php7-redis \
php7-gd \
php7-json \
php7-pcntl \
&& rm -rf /var/cache/apk/*
WORKDIR /html
EXPOSE 80
RUN sed -i 's/user = nobody/user = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/group = nobody/group = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.max_children = 5/pm.max_children = 100/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.start_servers = 2/pm.start_servers = 5/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.min_spare_servers = 1/pm.min_spare_servers = 5/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.max_spare_servers = 3/pm.max_spare_servers = 25/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/user = www-data/user = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/group = www-data/group = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php7/php.ini && \
echo "daemonize yes" >> /etc/redis.conf && \
ln -s /dev/null /var/log/nginx/access.log && \
ln -s /dev/stdout /var/log/nginx/error.log && \
cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime && \
echo "Europe/Berlin" > /etc/timezone && \
(crontab -l ; echo "* * * * * php /html/artisan schedule:run >> /dev/null 2>&1") | crontab -
COPY config/nginx.conf /etc/nginx/nginx.conf
COPY config/nginx-default.conf /etc/nginx/conf.d/default.conf
COPY --chown=root:nginx . /html
WORKDIR /html
EXPOSE 80
CMD chown -R root:nginx storage/logs/metager bootstrap/cache && \
chmod -R g+w storage/logs/metager bootstrap/cache && \
/etc/init.d/cron start && \
/etc/init.d/php7.3-fpm start && \
/etc/init.d/nginx start && \
/etc/init.d/redis-server start && \
su -s /bin/bash -c 'php artisan requests:fetcher' nginx
crond -L /dev/stdout && \
nginx && \
php-fpm7 -D && \
redis-server /etc/redis.conf && \
su -s /bin/sh -c 'php artisan requests:fetcher' nginx
FROM alpine:3.9.5
RUN apk add --update \
nginx \
tzdata \
ca-certificates \
dcron \
zip \
redis \
php7 \
php7-fpm \
php7-common \
php7-curl \
php7-mbstring \
php7-sqlite3 \
php7-pdo_mysql \
php7-pdo_sqlite \
php7-dom \
php7-simplexml \
php7-tokenizer \
php7-zip \
php7-redis \
php7-gd \
php7-json \
php7-pcntl \
&& rm -rf /var/cache/apk/*
WORKDIR /html
RUN sed -i 's/user = nobody/user = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/group = nobody/group = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.max_children = 5/pm.max_children = 100/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.start_servers = 2/pm.start_servers = 5/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.min_spare_servers = 1/pm.min_spare_servers = 5/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/pm.max_spare_servers = 3/pm.max_spare_servers = 25/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/user = www-data/user = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/group = www-data/group = nginx/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php7/php.ini && \
echo "daemonize yes" >> /etc/redis.conf && \
ln -s /dev/null /var/log/nginx/access.log && \
ln -s /dev/stdout /var/log/nginx/error.log && \
cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime && \
echo "Europe/Berlin" > /etc/timezone && \
(crontab -l ; echo "* * * * * php /html/artisan schedule:run >> /dev/null 2>&1") | crontab -
WORKDIR /html
EXPOSE 80
CMD chown -R root:nginx storage/logs/metager bootstrap/cache && \
chmod -R g+w storage/logs/metager bootstrap/cache && \
crond -L /dev/stdout && \
nginx && \
php-fpm7 -D && \
redis-server /etc/redis.conf && \
su -s /bin/sh -c 'php artisan requests:fetcher' nginx
......@@ -50,9 +50,6 @@ class RequestFetcher extends Command
*/
public function handle()
{
$pids = [];
pcntl_async_signals(true);
pcntl_signal(SIGINT, [$this, "sig_handler"]);
pcntl_signal(SIGTERM, [$this, "sig_handler"]);
pcntl_signal(SIGHUP, [$this, "sig_handler"]);
......@@ -114,9 +111,6 @@ class RequestFetcher extends Command
} finally {
curl_multi_close($this->multicurl);
}
foreach ($pids as $tmppid) {
\pcntl_waitpid($tmppid, $status, WNOHANG);
}
}
private function getCurlHandle($job)
......
......@@ -77,7 +77,7 @@ class AdminInterface extends Controller
private function getSearchEngineNames()
{
$url = config_path() . "/sumas.xml";
$xml = simplexml_load_file($url);
$xml = \simplexml_load_file($url);
$sumas = $xml->xpath("suma");
$names = array();
......
......@@ -42,7 +42,7 @@ class Assoziator extends Controller
}
$response = preg_replace("/^<\?.*\?>/s", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>", $response);
$content = simplexml_load_string($response);
$content = \simplexml_load_string($response);
$words = [];
......
......@@ -15,7 +15,7 @@ class FokiLoader
$sumaFile = config_path() . "/sumas.xml";
}
$xml = simplexml_load_file($sumaFile);
$xml = \simplexml_load_file($sumaFile);
$sumas = $xml->xpath("suma");
$foki = [];
......
......@@ -253,7 +253,7 @@ class MetaGerSearch extends Controller
$tips_text = file_get_contents($tipserver);
$tips = [];
try {
$tips_xml = simplexml_load_string($tips_text);
$tips_xml = \simplexml_load_string($tips_text);
$tips_xml->registerXPathNamespace('mg', 'http://metager.de/tips/');
$tips_xml = $tips_xml->xpath('mg:tip');
......
......@@ -86,7 +86,7 @@ class Quicktips
{
$quicktips_raw = preg_replace("/\r\n/si", "", $quicktips_raw);
try {
$content = simplexml_load_string($quicktips_raw);
$content = \simplexml_load_string($quicktips_raw);
if (!$content) {
return;
}
......
......@@ -9,7 +9,7 @@ abstract class XmlSearchengine extends Searchengine
public function loadresults($results)
{
try {
$resultsXml = simplexml_load_string($results);
$resultsXml = \simplexml_load_string($results);
$this->loadXmlResults($resultsXml);
} catch (\Exception $e) {
Log::error($e->getMessage());
......
......@@ -18,7 +18,7 @@ class BASE extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -33,7 +33,7 @@ class BASE extends Searchengine
$title = $attribute;
break;
case 'dclink':
$link = $attribute;
$link = $attribute;
$anzeigeLink = $link;
break;
case 'dcdescription':
......@@ -49,7 +49,7 @@ class BASE extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter
);
}
......
......@@ -18,17 +18,17 @@ class Blogsearch extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
$results = $content->xpath('//xml/docs/doc');
foreach ($results as $result) {
$title = $result->{"title"}->__toString();
$link = $result->{"url"}->__toString();
$title = $result->{"title"}->__toString();
$link = $result->{"url"}->__toString();
$anzeigeLink = $link;
$descr = $result->{"content"}->__toString();
$descr = $result->{"content"}->__toString();
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
......@@ -36,7 +36,7 @@ class Blogsearch extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter
);
}
......
......@@ -18,7 +18,7 @@ class Ebay extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......
......@@ -18,16 +18,16 @@ class Ecoshopper extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
$results = $content->xpath('//response/result[@name="response"]/doc');
foreach ($results as $result) {
$result = simplexml_load_string($result->saveXML());
$title = $result->xpath('//doc/str[@name="artikelName"]')[0]->__toString();
$link = $result->xpath('//doc/str[@name="artikelDeeplink"]')[0]->__toString();
$result = \simplexml_load_string($result->saveXML());
$title = $result->xpath('//doc/str[@name="artikelName"]')[0]->__toString();
$link = $result->xpath('//doc/str[@name="artikelDeeplink"]')[0]->__toString();
$anzeigeLink = parse_url($link);
if (isset($anzeigeLink['query'])) {
parse_str($anzeigeLink['query'], $query);
......@@ -49,10 +49,10 @@ class Ecoshopper extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter,
['partnershop' => false,
'image' => $image]
'image' => $image]
);
}
} catch (\Exception $e) {
......
......@@ -18,7 +18,7 @@ class Exalead extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......
......@@ -18,7 +18,7 @@ class Flickr extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -53,7 +53,7 @@ class Flickr extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......
......@@ -18,14 +18,13 @@ class Kelkoo extends Searchengine
$this->hash = md5($this->engine->host . $this->getString . $this->engine->port . $this->name);
}
public function loadResults($result)
{
$result = preg_replace("/\r\n/si", "", $result);
# delete namespace, allowing easier xpath access
$result = str_replace('xmlns="urn:yahoo:prods"', '', $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -40,23 +39,22 @@ class Kelkoo extends Searchengine
$results = $content->xpath('/ProductSearch/Products/Product/Offer');
foreach ($results as $result) {
$result = simplexml_load_string($result->saveXML());
$result = \simplexml_load_string($result->saveXML());
$title = $result->Title[0]->__toString();
$title = $result->Title[0]->__toString();
$price = floatval($result->Price[0]->Price[0]);
$deliveryPrice = floatval($result->Price[0]->DeliveryCost[0]);
$totalPrice = $price + $deliveryPrice;
$descr = "";
if(isset($result->Description[0]))
{
if (isset($result->Description[0])) {
$descr = $result->Description[0]->__toString();
}
$descr .= "<p>Preis: " . $price . " €</p>";
$image = $result->Images[0]->Image[0]->Url[0]->__toString();
$link = $result->Url[0]->__toString();
$descr .= "<p>Preis: " . $price . " €</p>";
$image = $result->Images[0]->Image[0]->Url[0]->__toString();
$link = $result->Url[0]->__toString();
$anzeigeLink = $result->Merchant[0]->Name[0]->__toString();
$this->counter++;
$this->results[] = new \App\Models\Result(
......@@ -65,10 +63,10 @@ class Kelkoo extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter,
['image' => $image,
'price' => $totalPrice * 100]
'price' => $totalPrice * 100]
);
}
} catch (\Exception $e) {
......@@ -84,7 +82,7 @@ class Kelkoo extends Searchengine
# delete namespace, allowing easier xpath access
$result = str_replace('xmlns="urn:yahoo:prods"', '', $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -120,22 +118,22 @@ class Kelkoo extends Searchengine
$next = new Kelkoo($this->name, $this->engine, $metager);
$next->unsignedGetString .= "&start=" . ($current + 20);
$next->getString = $next->UrlSigner($next->unsignedGetString);
$next->hash = md5($next->engine->host . $next->getString . $next->engine->port . $next->name);
$this->next = $next;
}
# kelkoogroup.com/kelkoo-customer-service/kelkoo-developer-network/shopping-services/samples/signing-url-php/
public function UrlSigner($path){
public function UrlSigner($path)
{
$urlPath = $path;
$partner = $this->engine->{"http-auth-credentials"}->ID;
$key = $this->engine->{"http-auth-credentials"}->Key;
$URL_sig = "hash";
$URL_ts = "timestamp";
$URL_partner = "aid";
$URL_partner = "aid";
$URLreturn = "";
$URLtmp = "";
$s = "";
......@@ -145,7 +143,7 @@ class Kelkoo extends Searchengine
$urlPath = str_replace(" ", "+", $urlPath);
// format URL
$URLtmp = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time;
// URL needed to create the token
$s = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time . $key;
$token = "";
......
......@@ -18,7 +18,7 @@ class Mg_produkt2 extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -27,14 +27,14 @@ class Mg_produkt2 extends Searchengine
foreach ($results as $result) {
$result = simplexml_load_string($result->saveXML());
$title = $result->xpath('/doc/arr[@name="artikelName"]')[0]->{"str"}->__toString();
$link = $result->xpath('/doc/arr[@name="artikelDeeplink"]')[0]->{"str"}->__toString();
$result = \simplexml_load_string($result->saveXML());
$title = $result->xpath('/doc/arr[@name="artikelName"]')[0]->{"str"}->__toString();
$link = $result->xpath('/doc/arr[@name="artikelDeeplink"]')[0]->{"str"}->__toString();
$anzeigeLink = parse_url($link);
parse_str($anzeigeLink['query'], $query);
$anzeigeLink = $query['diurl'];
$descr = $result->xpath('/doc/arr[@name="artikelBeschreibung"]')[0]->{"str"}->__toString();
$image = $result->xpath('/doc/arr[@name="artikelImageurl"]')[0]->{"str"}->__toString();
$descr = $result->xpath('/doc/arr[@name="artikelBeschreibung"]')[0]->{"str"}->__toString();
$image = $result->xpath('/doc/arr[@name="artikelImageurl"]')[0]->{"str"}->__toString();
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
......@@ -42,7 +42,7 @@ class Mg_produkt2 extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter,
['image' => $image]
);
......
......@@ -18,7 +18,7 @@ class Minisucher extends Searchengine
public function loadResults($content)
{
try {
$content = simplexml_load_string($content);
$content = \simplexml_load_string($content);
} catch (\Exception $e) {
return;
}
......@@ -35,7 +35,7 @@ class Minisucher extends Searchengine
foreach ($results as $result) {
try {
$counter++;
$result = simplexml_load_string($result->saveXML());
$result = \simplexml_load_string($result->saveXML());
$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
......
......@@ -18,22 +18,22 @@ class Opencrawlastronomie extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
$results = $content->xpath('//rss/channel/item');
$count = 0;
$count = 0;
foreach ($results as $result) {
if ($count > 10) {
break;
}
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$anzeigeLink = $link;
$descr = strip_tags($result->{"description"}->__toString());
$descr = strip_tags($result->{"description"}->__toString());
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
......@@ -41,7 +41,7 @@ class Opencrawlastronomie extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter
);
$count++;
......
......@@ -18,13 +18,13 @@ class Opencrawlpolitik extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
$results = $content->xpath('//rss/channel/item');
$count = 0;
$count = 0;
foreach ($results as $result) {
if ($count > 10) {
break;
......@@ -38,10 +38,10 @@ class Opencrawlpolitik extends Searchengine
$additionalInformation = ['date' => $dateVal];
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$anzeigeLink = $link;
$descr = strip_tags(htmlspecialchars_decode($result->{"description"}->__toString()));
$descr = strip_tags(htmlspecialchars_decode($result->{"description"}->__toString()));
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
......@@ -49,7 +49,7 @@ class Opencrawlpolitik extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter,
$additionalInformation
);
......
......@@ -18,22 +18,22 @@ class Opencrawlregengergie extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
$results = $content->xpath('//rss/channel/item');
$count = 0;
$count = 0;
foreach ($results as $result) {
if ($count > 10) {
break;
}
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$anzeigeLink = $link;
$descr = strip_tags($result->{"description"}->__toString());
$descr = strip_tags($result->{"description"}->__toString());
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
......@@ -41,7 +41,7 @@ class Opencrawlregengergie extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter
);
$count++;
......
......@@ -21,7 +21,7 @@ class Overture extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -84,7 +84,7 @@ class Overture extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......
......@@ -20,7 +20,7 @@ class OvertureAds extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -55,7 +55,7 @@ class OvertureAds extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......
......@@ -18,17 +18,17 @@ class Qip extends Searchengine
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
$results = $content->xpath('//channel/item');
foreach ($results as $result) {
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$anzeigeLink = $link;
$descr = $result->{"description"}->__toString();
$descr = $result->{"description"}->__toString();
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
......@@ -36,7 +36,7 @@ class Qip extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->counter
);
}
......
......@@ -23,7 +23,7 @@ class Scopia extends Searchengine
try {
$content = simplexml_load_string($result);
$content = \simplexml_load_string($result);
if (!$content) {
return;
}
......@@ -59,7 +59,7 @@ class Scopia extends Searchengine
$result = html_entity_decode($result);
$result = str_replace("&", "&amp;", $result);
try {