Get http request config for guzzle
@return array
553049
protected function getConfig()
    {
        $config = array();
        $config['headers'] = $this->headers;
        $config['config'] = array(
            'curl' => $this->curlConfig
        );
        $config['query'] = $this->parameters;
        $config['cookies'] = true;
        return $config;
    }
1227558
public function prepareRequest()
    {
        $version = $this->versionEngine->getVersion();
        $queryConfiguration = $version->parseRequest($this->columnConfigurations);
        $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);

        return [
            'version' => $version,
            'queryConfiguration' => $queryConfiguration
        ];
    }
1125512
public function getConfiguration(Request $request)
    {
        $this->request = $request;

        return [
            'base_uri' => $request->getOptions()->get('base_url'),
            'headers'  => $request->getHeaders()->all(),
            'query'    => $request->getParameters()->all()
        ];
    }
420593
protected function getParams()
    {
        $reserved = [
            $this->config('prefix', '').'sort',
            $this->config('prefix', '').'fields',
            $this->config('prefix', '').'limit',
            $this->config('prefix', '').'with',
            $this->config('prefix', '').'page',
        ];

        return $this->params ?: $this->request->except($reserved);
    }
45958
protected function getOptions(Request $request)
    {
        $configs = $this->getCorsConfigs();
        $uri = $request->getPathInfo() ?: '/';

        /** @var CorsConfig $bestMatch */
        $bestMatch = null;
        foreach ($configs as $config) {
            $path = $config->path;
            if ($request->is($path) || (Str::startsWith($path, '^') && preg_match('{' . $path . '}i', $uri))) {
                if ($bestMatch) {
                    // simple compare path lengths for accuracy
                    if (strlen($path) > strlen($bestMatch->path)) {
                        $bestMatch = $config;
                    }
                } else {
                    $bestMatch = $config;
                }
            }
        }

        if ($bestMatch) {
            return [
                "allowedOrigins"      => explode(',', $bestMatch->origin),
                "allowedHeaders"      => explode(',', $bestMatch->header),
                "exposedHeaders"      => explode(',', $bestMatch->exposed_header),
                "allowedMethods"      => $bestMatch->method,
                "maxAge"              => $bestMatch->max_age,
                "supportsCredentials" => $bestMatch->supports_credentials,
            ];
        }

        return [];
    }
785434
public function getRequest()
    {
        $path = $_SERVER['REQUEST_URI'];
    
        //remove ? url queries
        if (strpos($path, '?') !== false) {
            list($path, $tmp) = explode('?', $path, 2);
        }

        $array = explode('/', $path);
        
        $path = array(
            'string' => $path,
            'array' => $array);
            
        //set the request
        return $this('registry')
            ->set('method', $_SERVER['REQUEST_METHOD'])
            ->set('query', $_SERVER['QUERY_STRING'])
            ->set('body', file_get_contents('php://input'))
            ->set('server', $_SERVER)
            ->set('cookie', $_COOKIE)
            ->set('get', $_GET)
            ->set('post', $_POST)
            ->set('files', $_FILES)
            ->set('path', $path);
    }
614101
public function getConfig()
    {
        return [
            'service_manager'    => [
                'aliases'   => [
                    'ModuleRouteListener' => ModuleRouteListener::class
                ],
                'factories' => [
                    ModuleRouteListener::class                   => InvokableFactory::class,
                    Listener\ApplicationBootstrapListener::class => InvokableFactory::class,
                    Listener\ErrorLoggerListener::class          => InvokableFactory::class,
                    Listener\RouteTrailingSlashListener::class   => InvokableFactory::class,
                    Listener\SetupRouterBaseUrl::class           => InvokableFactory::class
                ]
            ],
            'controller_plugins' => [
                'aliases'   => [
                    'config'    => Controller\Plugin\Config::class,
                    'Config'    => Controller\Plugin\Config::class,
                    'flashdata' => Controller\Plugin\FlashData::class,
                    'flashData' => Controller\Plugin\FlashData::class,
                    'FlashData' => Controller\Plugin\FlashData::class,
                    'htmlclass' => Controller\Plugin\HtmlClass::class,
                    'htmlClass' => Controller\Plugin\HtmlClass::class,
                    'HtmlClass' => Controller\Plugin\HtmlClass::class,
                    'log'       => Controller\Plugin\Log::class,
                    'Log'       => Controller\Plugin\Log::class,
                    'redirect'  => Controller\Plugin\Redirect::class,
                    'Redirect'  => Controller\Plugin\Redirect::class,
                    'headtitle' => Controller\Plugin\Title::class,
                    'headTitle' => Controller\Plugin\Title::class,
                    'HeadTitle' => Controller\Plugin\Title::class,
                    'title'     => Controller\Plugin\Title::class,
                    'Title'     => Controller\Plugin\Title::class,
                    'url'       => Controller\Plugin\Url::class,
                    'Url'       => Controller\Plugin\Url::class
                ],
                'factories' => [
                    Controller\Plugin\Config::class    => function(ContainerInterface $container) {
                        return new  Controller\Plugin\Config($container->get('Config'));
                    },
                    Controller\Plugin\FlashData::class => InvokableFactory::class,
                    Controller\Plugin\HtmlClass::class => InvokableFactory::class,
                    Controller\Plugin\Log::class       => InvokableFactory::class,
                    Controller\Plugin\Redirect::class  => InvokableFactory::class,
                    Controller\Plugin\Title::class     => InvokableFactory::class,
                    Controller\Plugin\Url::class       => InvokableFactory::class
                ]
            ],
            'listeners'          => [
                ModuleRouteListener::class                 => ModuleRouteListener::class,
                Listener\ErrorLoggerListener::class        => Listener\ErrorLoggerListener::class,
                Listener\RouteTrailingSlashListener::class => Listener\RouteTrailingSlashListener::class,
                Listener\SetupRouterBaseUrl::class         => Listener\RouteTrailingSlashListener::class
            ]
        ];
    }
290223
public function getConfig(): array
    {
        $structure = [
            'locationMappings' => [],
            'defaultMappings' => [],
            'fallbackContentType' => $this->buildFallbackContentTypeStructure($this->fallbackContentType),
            'maxFileSize' => $this->maxFileSize,
        ];

        foreach ($this->locationMappings as $locationIdentifier => $locationConfiguration) {
            $structure['locationMappings'][$locationIdentifier] = [
                'contentTypeIdentifier' => $locationConfiguration['content_type_identifier'],
                'mimeTypeFilter' => $locationConfiguration['mime_type_filter'],
                'mappings' => [],
            ];

            foreach ($locationConfiguration['mappings'] as $mappingGroup) {
                $structure['locationMappings'][$locationIdentifier]['mappings'][] = $this->buildMappingGroupStructure($mappingGroup);
            }
        }

        foreach ($this->defaultMappings as $mappingGroup) {
            $structure['defaultMappings'][] = $this->buildMappingGroupStructure($mappingGroup);
        }

        return $structure;
    }
626804
public function getParams(): array
    {
        $params = [
            'openid.assoc_handle' => $this->request->get(self::OPENID_ASSOC_HANDLE),
            'openid.signed' => $this->request->get(self::OPENID_SIGNED),
            'openid.sig' => $this->request->get(self::OPENID_SIG),
            'openid.ns' => self::OPENID_NS,
            'openid.mode' => 'check_authentication',
        ];

        $signedParams = explode(',', $this->request->get(self::OPENID_SIGNED));

        foreach ($signedParams as $item) {
            $value = $this->request->get('openid_'.str_replace('.', '_', $item));
            $params['openid.'.$item] = get_magic_quotes_gpc() ? stripslashes($value) : $value;
        }

        return $params;
    }
337878
private function getProvidersConfig()
    {
        $config = [];
        foreach (self::PROVIDERS as $provider) {
            $config[ucfirst($provider)] = [
                'enabled' => (bool)$this->scopeConfig->getValue(
                    sprintf(self::CONFIG_PATH_SOCIAL_LOGIN_PROVIDER_ENABLED, $provider),
                    ScopeInterface::SCOPE_STORE
                ),
                'keys' => [
                    'key' => $this->scopeConfig->getValue(
                        sprintf(self::CONFIG_PATH_SOCIAL_LOGIN_PROVIDER_KEY, $provider),
                        ScopeInterface::SCOPE_STORE
                    ),
                    'secret' => $this->scopeConfig->getValue(
                        sprintf(self::CONFIG_PATH_SOCIAL_LOGIN_PROVIDER_SECRET, $provider),
                        ScopeInterface::SCOPE_STORE
                    ),
                ]
            ];
        }
        return $config;
    }
311536
public function getRedirectData()
    {
        $data = $this->getData();
        $request = $this->getRequest()->getParameters();

        return [
            'PaReq'   => $data['additional']['secure3d']['retransmit']['PaReq'],
            'MD'      => $data['additional']['secure3d']['retransmit']['MD'],
            'TermUrl' => $request['returnUrl'],
        ];
    }
245591
protected function getHttpClient()
    {
        $stack = HandlerStack::create();

        $stack->push(Middleware::retry(function ($retries, RequestInterface $request, ResponseInterface $response = null, TransferException $exception = null) {
            return $retries < 3 && ($exception instanceof ConnectException || ($response && $response->getStatusCode() >= 500));
        }, function ($retries) {
            return (int) pow(2, $retries) * 1000;
        }));

        return new GuzzleClient(['handler' => $stack]);
    }
33882
public function getData()
    {
        $this->validate('currency', 'description', 'encryptionKey', 'returnUrl');

        // The test mode is included to determine the redirect URL.

        return [
            'VPSProtocol' => $this->VPSProtocol,
            'TxType' => $this->getTxType(),
            'Vendor' => $this->getVendor(),
            'Crypt' => $this->generateCrypt($this->getCryptData()),
            'TestMode' => $this->getTestMode(),
        ];
    }
1214686
public function getGoogleAddressConfig()
    {
        $configuration = [];

        $isActive = $this->enhancementHelper->isActiveGoogleAddress();
        $configuration['isActiveGoogleAddress'] = $isActive;
        if ($isActive) {
            $configuration['googleAddressCountry'] = $this->enhancementHelper->getGoogleMapAddressCountries();
        }

        return $configuration;
    }
86765
public function requestOptions(): array
    {
        /**
         * Don't set any JSON if it's a get request
         */
        if ($this->requestType()->is(RequestType::HTTP_GET())) {
            return [];
        }
        $options = [
            RequestOptions::JSON => $this->toArray(),
        ];

        return $options;
    }
774336
public function getRequestHeaders()
    {
        // common headers
        $headers = array(
            'Accept' => 'application/json',
        );

        // set content type
        if ($this->getHttpMethod() !== 'GET') {
            $headers['Content-Type']    = 'application/x-www-form-urlencoded';
        }

        // prevent duplicate POSTs
        if ($this->getHttpMethod() === 'POST') {
            $headers['Idempotency-Key'] = $this->getIdempotencyKey();
        }

        return $headers;
    }
1178942
protected function getGuzzleClient()
    {
        $options = [];

        // Check if the client must use a proxy server.
        if (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy'])) {
            $proxy = !empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY'];
            $options['proxy'] = $proxy;
        }

        return new Client($options);
    }