Ejemplo n.º 1
0
 /**
  * Test for http request using generic interface
  *
  * @group medium
  *
  * @return void
  *
  * @dataProvider httpRequests
  *
  * @group network
  */
 public function testHttpRequest($url, $method, $return_only_status, $expected)
 {
     if (! function_exists('curl_init') && ! ini_get('allow_url_fopen')) {
         $this->markTestSkipped('neither curl nor allow_url_fopen are supported');
     }
     $result = PMA\libraries\Util::httpRequest($url, $method, $return_only_status);
     $this->validateHttp($result, $expected);
 }
Ejemplo n.º 2
0
/**
 * Sends report data to the error reporting server
 *
 * @param array $report the report info to be sent
 *
 * @return String the reply of the server
 */
function PMA_sendErrorReport($report)
{
    $data_string = json_encode($report);
    $response = PMA\libraries\Util::httpRequest(SUBMISSION_URL, "POST", false, $data_string, "Content-Type: application/json\r\n");
    return $response;
}