Ticket #5032: curl.patch

File curl.patch, 860 bytes (added by anonymous, 13 years ago)
  • modules/status/handler.php

     
    2525    header('Content-Type:  text/html; charset=UTF-8');
    2626
    2727// Load the status page
    28     if (function_exists('file_get_contents'))
     28    if (function_exists('curl_exec')) {
     29        $ch = curl_init("http://$masterhost:$statusport$xml_param");
     30        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
     31        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
     32        $status = curl_exec($ch);
     33        curl_close($ch);
     34    } else if (function_exists('file_get_contents'))
    2935        $status = file_get_contents("http://$masterhost:$statusport$xml_param");
    3036    else
    3137        $status = implode("\n", file("http://$masterhost:$statusport$xml_param"));