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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/aws/aws-sdk-php/src/Api/Parser/   drwxr-xr-x
Free 13.2 GB of 57.97 GB (22.76%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     EventParsingIterator.php (3.03 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Aws\Api\Parser;

use 
\Iterator;
use 
Aws\Exception\EventStreamDataException;
use 
Aws\Api\Parser\Exception\ParserException;
use 
Aws\Api\StructureShape;
use 
Psr\Http\Message\StreamInterface;

/**
 * @internal Implements a decoder for a binary encoded event stream that will
 * decode, validate, and provide individual events from the stream.
 */
class EventParsingIterator implements Iterator
{
    
/** @var StreamInterface */
    
private $decodingIterator;

    
/** @var StructureShape */
    
private $shape;

    
/** @var AbstractParser */
    
private $parser;

    public function 
__construct(
        
StreamInterface $stream,
        
StructureShape $shape,
        
AbstractParser $parser
    
) {
        
$this->decodingIterator = new DecodingEventStreamIterator($stream);
        
$this->shape $shape;
        
$this->parser $parser;
    }

    #[
\ReturnTypeWillChange]
    public function 
current()
    {
        return 
$this->parseEvent($this->decodingIterator->current());
    }

    #[
\ReturnTypeWillChange]
    public function 
key()
    {
        return 
$this->decodingIterator->key();
    }

    #[
\ReturnTypeWillChange]
    public function 
next()
    {
        
$this->decodingIterator->next();
    }

    #[
\ReturnTypeWillChange]
    public function 
rewind()
    {
        
$this->decodingIterator->rewind();
    }

    #[
\ReturnTypeWillChange]
    public function 
valid()
    {
        return 
$this->decodingIterator->valid();
    }

    private function 
parseEvent(array $event)
    {
        if (!empty(
$event['headers'][':message-type'])) {
            if (
$event['headers'][':message-type'] === 'error') {
                return 
$this->parseError($event);
            }
            if (
$event['headers'][':message-type'] !== 'event') {
                throw new 
ParserException('Failed to parse unknown message type.');
            }
        }

        if (empty(
$event['headers'][':event-type'])) {
            throw new 
ParserException('Failed to parse without event type.');
        }
        
$eventShape $this->shape->getMember($event['headers'][':event-type']);

        
$parsedEvent = [];
        foreach (
$eventShape['members'] as $shape => $details) {
            if (!empty(
$details['eventpayload'])) {
                
$payloadShape $eventShape->getMember($shape);
                if (
$payloadShape['type'] === 'blob') {
                    
$parsedEvent[$shape] = $event['payload'];
                } else {
                    
$parsedEvent[$shape] = $this->parser->parseMemberFromStream(
                        
$event['payload'],
                        
$payloadShape,
                        
null
                    
);
                }
            } else {
                
$parsedEvent[$shape] = $event['headers'][$shape];
            }
        }

        return [
            
$event['headers'][':event-type'] => $parsedEvent
        
];
    }

    private function 
parseError(array $event)
    {
        throw new 
EventStreamDataException(
            
$event['headers'][':error-code'],
            
$event['headers'][':error-message']
        );
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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