hersteller, $router_tmp[$x]['hersteller']) == 0) && (strcasecmp($router[$z]->modell, $router_tmp[$x]['modell']) == 0) && (strcasecmp($router[$z]->version, $router_tmp[$x]['version']) == 0)) { $entinst = $entwicklung[$i].$installation[$j]; $entinstlink = $entwicklung[$i].$installation[$j]."link"; $router[$z]->$entinst = 1; $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; $router_neu = 0; break; } } } if($router_neu == 1) { $z = count($router); $router[$z] = new ffrouter(); $router[$z]->hersteller = $router_tmp[$x]['hersteller']; $router[$z]->version = $router_tmp[$x]['version']; $router[$z]->modell = $router_tmp[$x]['modell']; $entinst = $entwicklung[$i].$installation[$j]; $entinstlink = $entwicklung[$i].$installation[$j]."link"; $router[$z]->$entinst = 1; $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; } } } } $router_tmp = array(); } } }else{ //Check if URL is reachable if (!remoteFileExists($firmware_download_path)) { throw new Exception("Firmwareverzeichnis offline oder nicht existent!"); } //Check if URL has index file (refer to https://forums.phpfreaks.com/topic/112764-using-scandir-on-other-websites/?p=579166 <- scandir has problem with index files) if ((@remoteFileExists($firmware_download_path."/index.htm"))||(@remoteFileExists($firmware_download_path."/index.html"))||(@remoteFileExists($firmware_download_path."/index.php"))) { throw new Exception("Firmwareverzeichnis darf keine index files besitzen!"); } $err = 0; for( $i=0; $i]+)/', file_get_contents($firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/"), $files_in_HTTP); foreach($files_in_HTTP["0"] as $key=>$value){ $files_in_HTTP["0"][$key]=substr($value, 6); } $files[$entwicklung[$i]][$installation[$j]] = array_slice($files_in_HTTP["0"], 1); for( $x=0; $xhersteller, $router_tmp[$x]['hersteller']) == 0) && (strcasecmp($router[$z]->modell, $router_tmp[$x]['modell']) == 0) && (strcasecmp($router[$z]->version, $router_tmp[$x]['version']) == 0)) { $entinst = $entwicklung[$i].$installation[$j]; $entinstlink = $entwicklung[$i].$installation[$j]."link"; $router[$z]->$entinst = 1; $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; $router_neu = 0; break; } } } if($router_neu == 1) { $z = count($router); $router[$z] = new ffrouter(); $router[$z]->hersteller = $router_tmp[$x]['hersteller']; $router[$z]->version = $router_tmp[$x]['version']; $router[$z]->modell = $router_tmp[$x]['modell']; $entinst = $entwicklung[$i].$installation[$j]; $entinstlink = $entwicklung[$i].$installation[$j]."link"; $router[$z]->$entinst = 1; $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; } } } } $router_tmp = array(); } } } for( $i=0; $ihersteller))) { if(is_file(strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version.".jpg"))) { $router[$i]->imagefront = strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version.".jpg"); } else { $router[$i]->imagefront = "router_images/keinbild.jpg"; } if(is_file(strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version."_back.jpg"))) { $router[$i]->imageback = strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version."_back.jpg"); } else { $router[$i]->imageback = "router_images/keinbild.jpg"; } } else { $router[$i]->imagefront = "router_images/keinbild.jpg"; $router[$i]->imageback = "router_images/keinbild.jpg"; } }