Ejemplo n.º 1
0
 /**
  * @param string $url
  */
 public function fetchURL($url)
 {
     global $aecConfig;
     if (strpos($url, '://') === false) {
         $purl = 'http://' . $url;
     } else {
         $purl = $url;
     }
     $url_parsed = parse_url($purl);
     $host = $url_parsed["host"];
     if (empty($url_parsed["port"])) {
         $port = 80;
     } else {
         $port = $url_parsed["port"];
     }
     $path = $url_parsed["path"];
     // Prevent 400 Error
     if (empty($path)) {
         $path = "/";
     }
     if ($url_parsed["query"] != "") {
         $path .= "?" . $url_parsed["query"];
     }
     if ($aecConfig->cfg['curl_default']) {
         $response = processor::doTheCurl($url, '');
     } else {
         $response = processor::doTheHttp($url, $path, '', $port);
     }
     return true;
 }