<commit_before><?php 

class Bill_Curl
{
    private $_url;
    
    public function __construct($url)
    {
        $this->_url = $url;
    }
    
    public function getResponseHeaders()
    {
        $ch = curl_init($this->_url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, TRUE);
        
        $response = curl_exec($ch);
        return curl_getinfo($ch);
    }
}<commit_msg>+ send request by curl<commit_after><?php 

class Bill_Curl
{
    private $_url;
    
    public function __construct($url)
    {
        $this->_url = $url;
    }
    
    public function getResponseHeaders()
    {
        $ch = curl_init($this->_url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, TRUE);
        
        $response = curl_exec($ch);
        return curl_getinfo($ch);
    }
	
	public static function sendRequestByCurl($request_url, array $data, $method = 'POST')
    {
        $ch = curl_init();
        //curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
        if (strtolower($method) == 'get')
        {
            curl_setopt($ch, CURLOPT_URL, $request_url . '?' . http_build_query($data));
        }
        else 
        {
            curl_setopt($ch, CURLOPT_URL, $request_url);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        }
        
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        
        $result = curl_exec($ch);
        return $result;
    }
}
{'fraction_non_alphanumeric': 0.12775616083009078, 'fraction_numerical': 0.0012970168612191958, 'mean_word_length': 2.1554192229038853, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2603261', 'n_tokens_mistral': 525, 'n_tokens_neox': 500, 'n_words': 91}