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

Delete Search.php

parent 3460d75c
<?php
namespace App\MetaGer;
use Illuminate\Http\Request;
use App\MetaGer\Searchengine;
class Search
{
public static function loadSearchEngines(Request $request)
{
# Überprüfe, welche Sumas eingeschaltet sind
$xml = simplexml_load_file(SUMA_FILE);
$enabledSearchengines = [];
$overtureEnabled = FALSE;
if(FOKUS === "angepasst")
{
$sumas = $xml->xpath("suma");
foreach($sumas as $suma)
{
if($request->has($suma["service"])
# || ( FOKUS !== "bilder"
# && ($suma["name"]->__toString() === "qualigo"
# || $suma["name"]->__toString() === "similar_product_ads"
# || ( !$overtureEnabled && $suma["name"]->__toString() === "overtureAds" )
# )
# )
){
if($suma["name"]->__toString() === "overture")
{
$overtureEnabled = TRUE;
}
$enabledSearchengines[] = $suma;
}
}
}else{
$sumas = $xml->xpath("suma");
foreach($sumas as $suma){
$types = explode(",",$suma["type"]);
if(in_array(FOKUS, $types)
# || ( FOKUS !== "bilder"
# && ($suma["name"]->__toString() === "qualigo"
# || $suma["name"]->__toString() === "similar_product_ads"
# || ( !$overtureEnabled && $suma["name"]->__toString() === "overtureAds" )
# )
# )
){
if($suma["name"]->__toString() === "overture")
{
$overtureEnabled = TRUE;
}
$enabledSearchengines[] = $suma;
}
}
}
$engines = [];
foreach($enabledSearchengines as $engine){
$path = "App\MetaGer\parserSkripte\\" . $engine["name"]->__toString();
$engines[] = new $path($engine);
}
return $engines;
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment