OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
Xpress
/
vendor
/
aws
/
aws-sdk-php
/
src
/
Api
/
Parser
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:17 AM
rwxr-xr-x
📄
AbstractParser.php
1.03 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
AbstractRestParser.php
5.67 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
Crc32ValidatingParser.php
1.53 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
DecodingEventStreamIterator.php
9.2 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
EventParsingIterator.php
5.07 KB
05/19/2025 10:07:17 AM
rw-r--r--
📁
Exception
-
05/19/2025 10:07:17 AM
rwxr-xr-x
📄
JsonParser.php
2.08 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
JsonRpcParser.php
2.35 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
MetadataParserTrait.php
2.66 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
NonSeekableStreamDecodingEventStreamIterator.php
2.53 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
PayloadParserTrait.php
1.5 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
QueryParser.php
1.79 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
RestJsonParser.php
1.26 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
RestXmlParser.php
1.1 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
XmlParser.php
5.19 KB
05/19/2025 10:07:17 AM
rw-r--r--
Editing: MetadataParserTrait.php
Close
<?php namespace Aws\Api\Parser; use Aws\Api\DateTimeResult; use Aws\Api\Shape; use Psr\Http\Message\ResponseInterface; trait MetadataParserTrait { /** * Extract a single header from the response into the result. */ protected function extractHeader( $name, Shape $shape, ResponseInterface $response, &$result ) { $value = $response->getHeaderLine($shape['locationName'] ?: $name); switch ($shape->getType()) { case 'float': case 'double': $value = (float) $value; break; case 'long': $value = (int) $value; break; case 'boolean': $value = filter_var($value, FILTER_VALIDATE_BOOLEAN); break; case 'blob': $value = base64_decode($value); break; case 'timestamp': try { $value = DateTimeResult::fromTimestamp( $value, !empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null ); break; } catch (\Exception $e) { // If the value cannot be parsed, then do not add it to the // output structure. return; } case 'string': if ($shape['jsonvalue']) { $value = $this->parseJson(base64_decode($value), $response); } break; } $result[$name] = $value; } /** * Extract a map of headers with an optional prefix from the response. */ protected function extractHeaders( $name, Shape $shape, ResponseInterface $response, &$result ) { // Check if the headers are prefixed by a location name $result[$name] = []; $prefix = $shape['locationName']; $prefixLen = strlen($prefix); foreach ($response->getHeaders() as $k => $values) { if (!$prefixLen) { $result[$name][$k] = implode(', ', $values); } elseif (stripos($k, $prefix) === 0) { $result[$name][substr($k, $prefixLen)] = implode(', ', $values); } } } /** * Places the status code of the response into the result array. */ protected function extractStatus( $name, ResponseInterface $response, array &$result ) { $result[$name] = (int) $response->getStatusCode(); } }