<commit_before><?php
namespace Exedra\Runtime;

/**
 * An application execution oriented response
 * Extends the original \Exedra\Http\Response
 * Except that the response body itself is not a stream
 * Will be translated to HTTP response on dispatch
 */
class Response extends \Exedra\Http\Response
{
	public function setBody($body, $mode = null)
	{
		$this->body = $body;

		return $this;
	}

	public function send()
	{
		$this->sendHeader();

		echo $this->body;
	}

	/**
	 * Close and response
	 */
	public function close()
	{
		$contents = ob_get_contents();
		ob_end_clean();
		header("Content-Encoding: none\r\n");
		ignore_user_abort(true);
		ob_start();
		echo $contents;
		$size = ob_get_length();
		header("Content-Length: $size");
		ob_end_flush();
		flush();
		ob_end_clean();
	}
}<commit_msg>Runtime\Response connection close<commit_after><?php
namespace Exedra\Runtime;

/**
 * An application execution oriented response
 * Extends the original \Exedra\Http\Response
 * Except that the response body itself is not a stream
 * Will be translated to HTTP response on dispatch
 */
class Response extends \Exedra\Http\Response
{
	public function setBody($body, $mode = null)
	{
		$this->body = $body;

		return $this;
	}

	public function send()
	{
		$this->sendHeader();

		echo $this->body;
	}

	/**
	 * Close and response
	 * http://stackoverflow.com/questions/138374/close-a-connection-early
	 */
	public function close()
	{
		$contents = ob_get_clean();
		header("Content-Encoding: none\r\n");
		ignore_user_abort(true);
		ob_start();
		echo $contents;
		$size = ob_get_length();
		header("Content-Length: $size");
		ob_end_flush();
		flush();
		ob_end_clean();
	}
}
{'fraction_non_alphanumeric': 0.13733650416171225, 'fraction_numerical': 0.0035671819262782403, 'mean_word_length': 3.95, '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': '3714415', 'n_tokens_mistral': 596, 'n_tokens_neox': 548, 'n_words': 144}