__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?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 = $this->chooseDecodingIterator($stream);
        $this->shape = $shape;
        $this->parser = $parser;
    }

    /**
     * This method choose a decoding iterator implementation based on if the stream
     * is seekable or not.
     *
     * @param $stream
     *
     * @return Iterator
     */
    private function chooseDecodingIterator($stream)
    {
        if ($stream->isSeekable()) {
            return new DecodingEventStreamIterator($stream);
        } else {
            return new NonSeekableStreamDecodingEventStreamIterator($stream);
        }
    }

    #[\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.');
            }
        }

        $eventType = $event['headers'][':event-type'] ?? null;
        if (empty($eventType)) {
            throw new ParserException('Failed to parse without event type.');
        }

        $eventPayload = $event['payload'];
        if ($eventType === 'initial-response') {
            return $this->parseInitialResponseEvent($eventPayload);
        }

        $eventShape = $this->shape->getMember($eventType);

        return [
            $eventType => array_merge(
                $this->parseEventHeaders($event['headers'], $eventShape),
                $this->parseEventPayload($eventPayload, $eventShape)
            )
        ];
    }

    /**
     * @param $headers
     * @param $eventShape
     *
     * @return array
     */
    private function parseEventHeaders($headers, $eventShape): array
    {
        $parsedHeaders = [];
        foreach ($eventShape->getMembers() as $memberName => $memberProps) {
            if (isset($memberProps['eventheader'])) {
                $parsedHeaders[$memberName] = $headers[$memberName];
            }
        }

        return $parsedHeaders;
    }

    /**
     * @param $payload
     * @param $eventShape
     *
     * @return array
     */
    private function parseEventPayload($payload, $eventShape): array
    {
        $parsedPayload = [];
        foreach ($eventShape->getMembers() as $memberName => $memberProps) {
            $memberShape = $eventShape->getMember($memberName);
            if (isset($memberProps['eventpayload'])) {
                if ($memberShape->getType() === 'blob') {
                    $parsedPayload[$memberName] = $payload;
                } else {
                    $parsedPayload[$memberName] = $this->parser->parseMemberFromStream(
                        $payload,
                        $memberShape,
                        null
                    );
                }

                break;
            }
        }

        if (empty($parsedPayload) && !empty($payload->getContents())) {
            /**
             * If we did not find a member with an eventpayload trait, then we should deserialize the payload
             * using the event's shape.
             */
            $parsedPayload = $this->parser->parseMemberFromStream($payload, $eventShape, null);
        }

        return $parsedPayload;
    }

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

    private function parseInitialResponseEvent($payload): array
    {
        return ['initial-response' => json_decode($payload, true)];
    }
}

Filemanager

Name Type Size Permission Actions
Exception Folder 0777
AbstractParser.php File 1006 B 0777
AbstractRestParser.php File 5.49 KB 0777
Crc32ValidatingParser.php File 1.48 KB 0777
DecodingEventStreamIterator.php File 8.86 KB 0777
EventParsingIterator.php File 4.89 KB 0777
JsonParser.php File 2.01 KB 0777
JsonRpcParser.php File 2.27 KB 0777
MetadataParserTrait.php File 2.57 KB 0777
NonSeekableStreamDecodingEventStreamIterator.php File 2.43 KB 0777
PayloadParserTrait.php File 1.44 KB 0777
QueryParser.php File 1.73 KB 0777
RestJsonParser.php File 1.22 KB 0777
RestXmlParser.php File 1.06 KB 0777
XmlParser.php File 5.02 KB 0777
Filemanager