static function _fetchURL($url)
    {
        if (self::$disable_url_fetch) {
            return false;
        }

        $parts = parse_url($url);
        $data = '';
        switch ($parts['scheme']) {
            case 'http':
                $fsock = @fsockopen($parts['host'], isset($parts['port']) ? $parts['port'] : 80);
                if (!$fsock) {
                    return false;
                }
                fputs($fsock, "GET $parts[path] HTTP/1.0\r\n");
                fputs($fsock, "Host: $parts[host]\r\n\r\n");
                $line = fgets($fsock, 1024);
                if (strlen($line) < 3) {
                    return false;
                }
                preg_match('#HTTP/1.\d (\d{3})#', $line, $temp);
                if ($temp[1] != '200') {
                    return false;
                }

                // skip the rest of the headers in the http response
                while (!feof($fsock) && fgets($fsock, 1024) != "\r\n") {
                }

                while (!feof($fsock)) {
                    $data.= fread($fsock, 1024);
                }

                break;
            //case 'ftp':
            //case 'ldap':
            //default:
        }

        return $data;
    }
static function _fetchURL($url)
    {
        if (self::$disable_url_fetch) {
            return false;
        }

        $parts = parse_url($url);
        $data = '';
        switch ($parts['scheme']) {
            case 'http':
                $fsock = @fsockopen($parts['host'], isset($parts['port']) ? $parts['port'] : 80);
                if (!$fsock) {
                    return false;
                }
                fputs($fsock, "GET $parts[path] HTTP/1.0\r\n");
                fputs($fsock, "Host: $parts[host]\r\n\r\n");
                $line = fgets($fsock, 1024);
                if (strlen($line) < 3) {
                    return false;
                }
                preg_match('#HTTP/1.\d (\d{3})#', $line, $temp);
                if ($temp[1] != '200') {
                    return false;
                }

                // skip the rest of the headers in the http response
                while (!feof($fsock) && fgets($fsock, 1024) != "\r\n") {
                }

                while (!feof($fsock)) {
                    $data.= fread($fsock, 1024);
                }

                break;
            //case 'ftp':
            //case 'ldap':
            //default:
        }

        return $data;
    }
static function _fetchURL ( $ url ) { if ( self :: $ disable_url_fetch ) { return false ; } $ parts = parse_url ( $ url ) ; $ data = '' ; switch ( $ parts [ 'scheme' ] ) { case 'http' : $ fsock = @ fsockopen ( $ parts [ 'host' ] , isset ( $ parts [ 'port' ] ) ? $ parts [ 'port' ] : 80 ) ; if ( ! $ fsock ) { return false ; } fputs ( $ fsock , "GET $parts[path] HTTP/1.0\r\n" ) ; fputs ( $ fsock , "Host: $parts[host]\r\n\r\n" ) ; $ line = fgets ( $ fsock , 1024 ) ; if ( strlen ( $ line ) < 3 ) { return false ; } preg_match ( '#HTTP/1.\d (\d{3})#' , $ line , $ temp ) ; if ( $ temp [ 1 ] != '200' ) { return false ; } // skip the rest of the headers in the http response while ( ! feof ( $ fsock ) && fgets ( $ fsock , 1024 ) != "\r\n" ) { } while ( ! feof ( $ fsock ) ) { $ data .= fread ( $ fsock , 1024 ) ; } break ; //case 'ftp': //case 'ldap': //default: } return $ data ; }
Fetches a URL

@param string $url
@access private
@return bool|string
Fetches a URL