HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/ebrucolor.com/wp-content/plugins/backup/src/JetBackup/Web/JetHttpResponse.php
<?php
/*
*
* JetBackup @ package
* Created By Idan Ben-Ezra
*
* Copyrights @ JetApps
* https://www.jetapps.com
*
**/
namespace JetBackup\Web;

defined("__JETBACKUP__") or die("Restricted Access.");

class JetHttpResponse {

	private bool $_is_ftp = false;
	private string $_body = '';
	private string $_headers_buffer = '';
	private ?JetHttpResponseHeaders $_headers = null;

	/**
	 * @param bool|null $isFTP
	 *
	 * @return bool
	 */
	public function isFTP(?bool $isFTP=null): bool {
		if($isFTP !== null) $this->_is_ftp = $isFTP; 
		return $this->_is_ftp;
	}
	
	/**
	 * @param string $body
	 *
	 * @return void
	 */
	public function setBody(string $body):void {
		$this->_body = $body;
	}

	/**
	 * @param string $body
	 *
	 * @return void
	 */
	public function appendBody(string $body):void {
		$this->_body .= $body;
	}

	/**
	 * @return string
	 */
	public function getBody():string {
		return $this->_body;
	}

	/**
	 * @param string $headers
	 *
	 * @return void
	 */
	public function setHeadersBuffer(string $headers):void {
		$this->_headers_buffer = $headers;
	}

	/**
	 * @param string $headers
	 *
	 * @return void
	 */
	public function appendHeadersBuffer(string $headers):void {
		$this->_headers_buffer .= $headers;
	}

	/**
	 * @return JetHttpResponseHeaders|null
	 */
	public function getHeaders():?JetHttpResponseHeaders {
		if(!$this->_headers && $this->_headers_buffer) $this->_headers = new JetHttpResponseHeaders($this->_headers_buffer, $this->_is_ftp);
		return $this->_headers;
	}
}