Get the guzzle options.

@param string $hostname

@return array
349783
private function fetchNewsOptions($hostname)
    {
        $driver = $this->app['db']->getDatabasePlatform()->getName();

        $options = [
            'query' => [
                'v'    => Bolt\Version::VERSION,
                'p'    => PHP_VERSION,
                'db'   => $driver,
                'name' => $hostname,
            ],
            'connect_timeout' => 5,
            'timeout'         => 10,
        ];

        if ($this->getOption('general/httpProxy')) {
            if ($this->getOption('general/httpProxy/user')) {
                $options['proxy'] = sprintf(
                    '%s:%s@%s',
                    $this->getOption('general/httpProxy/user'),
                    $this->getOption('general/httpProxy/password'),
                    $this->getOption('general/httpProxy/host')
                );
            } else {
                $options['proxy'] = $this->getOption('general/httpProxy/host');
            }
        }

        return $options;
    }
413251
public function getColumnValues($columnName = 'PrimaryKey')
    {
        $ret = [];
        $keyGetterMethod = 'get' . ucfirst($columnName);
        foreach ($this as $obj) {
            $ret[] = $obj->$keyGetterMethod();
        }

        return $ret;
    }
504457
private function parseSuffix($hostname)
    {
        $hostnameParts = explode('.', $hostname);
        $realSuffix = null;

        for ($i = 0, $count = count($hostnameParts); $i < $count; $i++) {
            $possibleSuffix = implode('.', array_slice($hostnameParts, $i));
            $exceptionSuffix = '!' . $possibleSuffix;

            if ($this->suffixExists($exceptionSuffix)) {
                $realSuffix = implode('.', array_slice($hostnameParts, $i + 1));

                break;
            }

            if ($this->suffixExists($possibleSuffix)) {
                $realSuffix = $possibleSuffix;

                break;
            }

            $wildcardTld = '*.' . implode('.', array_slice($hostnameParts, $i + 1));

            if ($this->suffixExists($wildcardTld)) {
                $realSuffix = $possibleSuffix;

                break;
            }
        }

        return $realSuffix;
    }
777817
protected function getAllRouteNames($resourceName = null)
    {
        $resourceName = $resourceName ?? $this->resourceName;

        return [
            'index'   => $this->prefix.$this->resourceName.'.index',
            'create'  => $this->prefix.$this->resourceName.'.create',
            'store'   => $this->prefix.$this->resourceName.'.store',
            'show'    => $this->prefix.$this->resourceName.'.show',
            'edit'    => $this->prefix.$this->resourceName.'.edit',
            'update'  => $this->prefix.$this->resourceName.'.update',
            'destroy' => $this->prefix.$this->resourceName.'.destroy',
        ];
    }
594133
private function getNews($hostname)
    {
        // Cached for two hours.
        $news = $this->app['cache']->fetch('dashboardnews');
        if ($news !== false) {
            $this->app['logger.system']->info('Using cached data', ['event' => 'news']);

            return $news;
        }

        // If not cached, get fresh news.
        $news = $this->fetchNews($hostname);

        $this->app['cache']->save('dashboardnews', $news, 7200);

        return $news;
    }
919615
public function listeners(string $eventName): array
    {
        if (!\array_key_exists($eventName, $this->listenerIndex)) {
            // Create a new index.
            $listeners = [];
            $listenersPriority = [];
            if (isset($this->listeners[$eventName])) {
                foreach ($this->listeners[$eventName] as $listener) {
                    $listenersPriority[] = $listener[0];
                    $listeners[] = $listener[1];
                }
            }

            foreach ($this->wildcardListeners as $wcEvent => $wcListeners) {
                // Wildcard match
                if (\substr($eventName, 0, \strlen($wcEvent)) === $wcEvent) {
                    foreach ($wcListeners as $listener) {
                        $listenersPriority[] = $listener[0];
                        $listeners[] = $listener[1];
                    }
                }
            }

            // Sorting by priority
            \array_multisort($listenersPriority, SORT_NUMERIC, $listeners);

            // Creating index
            $this->listenerIndex[$eventName] = $listeners;
        }

        return $this->listenerIndex[$eventName];
    }
1142808
public function getOptionValue($optionName)
    {
        if (!isset($this->options[$optionName])) {
            throw new \InvalidArgumentException(sprintf('Invalid option name "%s", possible options: %s', $optionName, implode(', ', array_keys($this->options))), __LINE__);
        }
        return array_key_exists('value', $this->options[$optionName]) ? $this->options[$optionName]['value'] : $this->options[$optionName]['default'];
    }
1106525
private function getBasicCurlOptions() {
        $curlOptions = $this->getOption(self::CURL_OPTIONS_KEY, array());
        $curlOptions[CURLOPT_HEADER] = true;
        $curlOptions[CURLOPT_RETURNTRANSFER] = true;
        $curlOptions[CURLOPT_USERAGENT] = $this->getOption(self::USER_AGENT_KEY);
        $curlOptions[CURLOPT_URL] = $this->getOption(self::BASE_URL_KEY);
        return $curlOptions;
    }
1173273
public function getVHostConfig($serverName, $vhostName)
    {
        list($response) = $this->getVHostConfigWithHttpInfo($serverName, $vhostName);
        return $response;
    }
363234
public function getDoc($host = null) : array
    {
        return $this->serverDocNormalizer->normalize(
            $this->httpServerDocCreator->create($host)
        );
    }
317412
public static function getOptions($optionName = null)
    {
        $options = array();
        foreach (ini_get_all('session') as $sysOptionName => $sysOptionValues) {
            $options[substr($sysOptionName, 8)] = $sysOptionValues['local_value'];
        }
        foreach (self::$_localOptions as $localOptionName => $localOptionMemberName) {
            $options[$localOptionName] = self::${$localOptionMemberName};
        }

        if ($optionName) {
            if (array_key_exists($optionName, $options)) {
                return $options[$optionName];
            }
            return null;
        }

        return $options;
    }
228494
public function getListeners(string $eventName = ''): array
    {
        if (0 !== \count($this->serviceListeners)) {
            if ('' === $eventName) {
                $this->lazyLoadServices(\array_keys($this->serviceListeners));
            } elseif (\array_key_exists($eventName, $this->serviceListeners)) {
                $this->lazyLoadServices([$eventName]);
            }
        }
        return parent::getListeners($eventName);
    }
766770
private function getOptions(array $config = []): array
    {
        $resolver = new OptionsResolver();

        $resolver->setDefaults([
            'timeout' => 5,
            'verify_peer' => true,
            'verify_host' => 2,
            'proxy' => null,
        ]);

        $resolver->setAllowedTypes('timeout', 'int');
        $resolver->setAllowedTypes('verify_peer', 'bool');
        $resolver->setAllowedTypes('verify_host', 'int');
        $resolver->setAllowedTypes('proxy', ['string', 'null']);

        return $resolver->resolve($config);
    }
526381
public function checkDomain($hostname)
    {
        $result = array();
        foreach ($this->getBlServers() as $blServer) {
            if ($blServer->supportDomain()) {
                $result[] = $blServer->getResolver()->execute($hostname);
            }
        }

        return $result;
    }
1181393
public function getListeners($eventName = null) {

        if ($eventName) {

            if (empty($this->registry[$eventName])) {
                return [];
            }

            return $this->getSortedRegistry($eventName);

        }

        foreach ($this->registry as $eventName => $listeners) {
            $this->getSortedRegistry($eventName);
        }

        return $this->sortedRegistry;

    }
1267745
public function getHostGroupsByHost(Host $host)
    {
        return array_values(
            array_filter(
                $this->hostGroups,
                function ($g) use ($host) {
                    return $g->hasHost($host);
                }
            )
        );
    }
768496
private function generateHeaders($options, $hostname)
    {
        $headers = array(
            self::OSS_CONTENT_MD5 => '',
            self::OSS_CONTENT_TYPE => isset($options[self::OSS_CONTENT_TYPE]) ? $options[self::OSS_CONTENT_TYPE] : self::DEFAULT_CONTENT_TYPE,
            self::OSS_DATE => isset($options[self::OSS_DATE]) ? $options[self::OSS_DATE] : gmdate('D, d M Y H:i:s \G\M\T'),
            self::OSS_HOST => $hostname,
        );
        if (isset($options[self::OSS_CONTENT_MD5])) {
            $headers[self::OSS_CONTENT_MD5] = $options[self::OSS_CONTENT_MD5];
        }

        //Add stsSecurityToken
        if ((!is_null($this->securityToken)) && (!$this->enableStsInUrl)) {
            $headers[self::OSS_SECURITY_TOKEN] = $this->securityToken;
        }
        //Merge HTTP headers
        if (isset($options[self::OSS_HEADERS])) {
            $headers = array_merge($headers, $options[self::OSS_HEADERS]);
        }
        return $headers;
    }