<commit_before><?php
/**
 * Created by PhpStorm.
 * User: hamway
 * Date: 13.09.14
 * Time: 18:24
 */
namespace Hamway\LCurl;

class LCurl {
	protected $ch;
	protected $buffer;
	protected $url;
	protected $charset = 'utf-8';

	/**
	 * Send get request.
	 *
	 * @param $url
	 * @param $buffer
	 * @return bool
	 */
	public function get($url, $buffer = 128) {
		if (!$url) return false;

		$this->setBuffer($buffer);
		$this->init();
		$this->setUrl($url);
<commit_msg>add buildQuery method<commit_after><?php
/**
 * Created by PhpStorm.
 * User: hamway
 * Date: 13.09.14
 * Time: 18:24
 */
namespace Hamway\LCurl;

class LCurl {
	protected $ch;
	protected $buffer;
	protected $url;
	protected $charset = 'utf-8';

	/**
	 * Build an URL with an optional query string.
	 *
	 * @param  string $url   the base URL without any query string
	 * @param  array  $query array of GET parameters
	 *
	 * @return string
	 */
	public function buildUrl($url, array $query)
	{
		// append the query string
		if (!empty($query)) {
			$queryString = http_build_query($query);
			$url .= '?' . $queryString;
		}

		return $url;
	}

	/**
	 * Send get request.
	 *
	 * @param $url
	 * @param $buffer
	 * @return bool
	 */
	public function get($url, $buffer = 128) {
		if (!$url) return false;

		$this->setBuffer($buffer);
		$this->init();
		$this->setUrl($url);

{'fraction_non_alphanumeric': 0.1631892697466468, 'fraction_numerical': 0.020864381520119227, 'mean_word_length': 3.1196319018404908, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1652895', 'n_tokens_mistral': 529, 'n_tokens_neox': 467, 'n_words': 134}