Server IP : 172.67.158.161 / Your IP : 18.118.37.188 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/thread-self/root/proc/self/cwd/wp-content/plugins/duplicator-pro/aws/Aws/Common/Command/ |
Upload File : |
<?php namespace DuplicatorPro\Aws\Common\Command; defined("ABSPATH") or die(""); use DuplicatorPro\Guzzle\Service\Description\Operation; use DuplicatorPro\Guzzle\Service\Command\CommandInterface; use DuplicatorPro\Guzzle\Http\Message\Response; use DuplicatorPro\Guzzle\Service\Description\Parameter; use DuplicatorPro\Guzzle\Service\Command\LocationVisitor\Response\XmlVisitor; /** * Class used for custom AWS XML response parsing of query services */ class XmlResponseLocationVisitor extends XmlVisitor { /** * {@inheritdoc} */ public function before(CommandInterface $command, array &$result) { parent::before($command, $result); // Unwrapped wrapped responses $operation = $command->getOperation(); if ($operation->getServiceDescription()->getData('resultWrapped')) { $wrappingNode = $operation->getName() . 'Result'; if (isset($result[$wrappingNode])) { $result = $result[$wrappingNode] + $result; unset($result[$wrappingNode]); } } } /** * Accounts for wrapper nodes * {@inheritdoc} */ public function visit( CommandInterface $command, Response $response, Parameter $param, &$value, $context = null ) { parent::visit($command, $response, $param, $value, $context); // Account for wrapper nodes (e.g. RDS, ElastiCache, etc) if ($param->getData('wrapper')) { $wireName = $param->getWireName(); $value += $value[$wireName]; unset($value[$wireName]); } } /** * Filter used when converting XML maps into associative arrays in service descriptions * * @param array $value Value to filter * @param string $entryName Name of each entry * @param string $keyName Name of each key * @param string $valueName Name of each value * * @return array Returns the map of the XML data */ public static function xmlMap($value, $entryName, $keyName, $valueName) { $result = array(); foreach ($value as $entry) { $result[$entry[$keyName]] = $entry[$valueName]; } return $result; } }