<?php

namespace auctionforge\inc;

class CurlRequest
{
    /**
     * Ping request to deployment server.
     * @param $url
     * @param $data
     * @return array
     */
    public static function send($url, $data)
    {
        $serverUri = $url;
        $params = http_build_query($data);
        
        $curlInit = curl_init();
        curl_setopt_array($curlInit, array(
            CURLOPT_URL => $serverUri . '?' . $params,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 0,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'GET',
        ));
        curl_close($curlInit);
    }
}